mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
Remove page queues locking from all sf_buf_mext()-like functions. The page
lock now suffices. Fix a couple nearby style violations.
This commit is contained in:
parent
fd8c28bfdf
commit
f0c0d3998d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207708
@ -81,7 +81,6 @@ socow_iodone(void *addr, void *args)
|
||||
sf_buf_free(sf);
|
||||
/* remove COW mapping */
|
||||
vm_page_lock(pp);
|
||||
vm_page_lock_queues();
|
||||
vm_page_cowclear(pp);
|
||||
vm_page_unwire(pp, 0);
|
||||
/*
|
||||
@ -91,7 +90,6 @@ socow_iodone(void *addr, void *args)
|
||||
*/
|
||||
if (pp->wire_count == 0 && pp->object == NULL)
|
||||
vm_page_free(pp);
|
||||
vm_page_unlock_queues();
|
||||
vm_page_unlock(pp);
|
||||
socow_stats.iodone++;
|
||||
}
|
||||
@ -147,9 +145,8 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
||||
* Allocate an sf buf
|
||||
*/
|
||||
sf = sf_buf_alloc(pp, SFB_CATCH);
|
||||
if (!sf) {
|
||||
if (sf == NULL) {
|
||||
vm_page_lock(pp);
|
||||
vm_page_lock_queues();
|
||||
vm_page_cowclear(pp);
|
||||
vm_page_unwire(pp, 0);
|
||||
/*
|
||||
@ -159,7 +156,6 @@ socow_setup(struct mbuf *m0, struct uio *uio)
|
||||
*/
|
||||
if (pp->wire_count == 0 && pp->object == NULL)
|
||||
vm_page_free(pp);
|
||||
vm_page_unlock_queues();
|
||||
vm_page_unlock(pp);
|
||||
socow_stats.fail_sf_buf++;
|
||||
return(0);
|
||||
|
@ -1716,7 +1716,6 @@ sf_buf_mext(void *addr, void *args)
|
||||
m = sf_buf_page(args);
|
||||
sf_buf_free(args);
|
||||
vm_page_lock(m);
|
||||
vm_page_lock_queues();
|
||||
vm_page_unwire(m, 0);
|
||||
/*
|
||||
* Check for the object going away on us. This can
|
||||
@ -1725,7 +1724,6 @@ sf_buf_mext(void *addr, void *args)
|
||||
*/
|
||||
if (m->wire_count == 0 && m->object == NULL)
|
||||
vm_page_free(m);
|
||||
vm_page_unlock_queues();
|
||||
vm_page_unlock(m);
|
||||
if (addr == NULL)
|
||||
return;
|
||||
@ -2111,7 +2109,6 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
|
||||
}
|
||||
if (error) {
|
||||
vm_page_lock(pg);
|
||||
vm_page_lock_queues();
|
||||
vm_page_unwire(pg, 0);
|
||||
/*
|
||||
* See if anyone else might know about
|
||||
@ -2120,10 +2117,8 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
|
||||
*/
|
||||
if (pg->wire_count == 0 && pg->valid == 0 &&
|
||||
pg->busy == 0 && !(pg->oflags & VPO_BUSY) &&
|
||||
pg->hold_count == 0) {
|
||||
pg->hold_count == 0)
|
||||
vm_page_free(pg);
|
||||
}
|
||||
vm_page_unlock_queues();
|
||||
vm_page_unlock(pg);
|
||||
VM_OBJECT_UNLOCK(obj);
|
||||
if (error == EAGAIN)
|
||||
|
@ -113,11 +113,9 @@ zbuf_page_free(vm_page_t pp)
|
||||
{
|
||||
|
||||
vm_page_lock(pp);
|
||||
vm_page_lock_queues();
|
||||
vm_page_unwire(pp, 0);
|
||||
if (pp->wire_count == 0 && pp->object == NULL)
|
||||
vm_page_free(pp);
|
||||
vm_page_unlock_queues();
|
||||
vm_page_unlock(pp);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user