From 25b80a64b9fc30297401a041a69a8229872b01c4 Mon Sep 17 00:00:00 2001 From: alc Date: Wed, 3 Nov 2004 20:17:31 +0000 Subject: The synchronization provided by vm object locking has eliminated the need for most calls to vm_page_busy(). Specifically, most calls to vm_page_busy() occur immediately prior to a call to vm_page_remove(). In such cases, the containing vm object is locked across both calls. Consequently, the setting of the vm page's PG_BUSY flag is not even visible to other threads that are following the synchronization protocol. This change (1) eliminates the calls to vm_page_busy() that immediately precede a call to vm_page_remove() or functions, such as vm_page_free() and vm_page_rename(), that call it and (2) relaxes the requirement in vm_page_remove() that the vm page's PG_BUSY flag is set. Now, the vm page's PG_BUSY flag is set only when the vm object lock is released while the vm page is still in transition. Typically, this is when it is undergoing I/O. --- sys/vm/vm_pageout.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sys/vm/vm_pageout.c') diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 3d21c1f..cfb9eab 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -823,7 +823,6 @@ rescan0: /* * Invalid pages can be easily freed */ - vm_page_busy(m); pmap_remove_all(m); vm_page_free(m); cnt.v_dfree++; @@ -1107,7 +1106,6 @@ unlock_and_continue: cache_rover = (m->pc + PQ_PRIME2) & PQ_L2_MASK; object = m->object; VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); - vm_page_busy(m); vm_page_free(m); VM_OBJECT_UNLOCK(object); cnt.v_dfree++; -- cgit v1.1