summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_mmap.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-26 18:00:44 +0000
committeralc <alc@FreeBSD.org>2010-05-26 18:00:44 +0000
commit3f1d4b057cf7217e3fe56dcd1bd29db76406ae5f (patch)
tree95cb060d8736de18caf3932cd92f06f852f69659 /sys/vm/vm_mmap.c
parent8dd88ee72437269f6edd3612fb57c46b8adfc020 (diff)
downloadFreeBSD-src-3f1d4b057cf7217e3fe56dcd1bd29db76406ae5f.zip
FreeBSD-src-3f1d4b057cf7217e3fe56dcd1bd29db76406ae5f.tar.gz
Push down page queues lock acquisition in pmap_enter_object() and
pmap_is_referenced(). Eliminate the corresponding page queues lock acquisitions from vm_map_pmap_enter() and mincore(), respectively. In mincore(), this allows some additional cases to complete without ever acquiring the page queues lock. Assert that the page is managed in pmap_is_referenced(). On powerpc/aim, push down the page queues lock acquisition from moea*_is_modified() and moea*_is_referenced() into moea*_query_bit(). Again, this will allow some additional cases to complete without ever acquiring the page queues lock. Reorder a few statements in vm_page_dontneed() so that a race can't lead to an old reference persisting. This scenario is described in detail by a comment. Correct a spelling error in vm_page_dontneed(). Assert that the object is locked in vm_page_clear_dirty(), and restrict the page queues lock assertion to just those cases in which the page is currently writeable. Add object locking to vnode_pager_generic_putpages(). This was the one and only place where vm_page_clear_dirty() was being called without the object being locked. Eliminate an unnecessary vm_page_lock() around vnode_pager_setsize()'s call to vm_page_clear_dirty(). Change vnode_pager_generic_putpages() to the modern-style of function definition. Also, change the name of one of the parameters to follow virtual memory system naming conventions. Reviewed by: kib
Diffstat (limited to 'sys/vm/vm_mmap.c')
-rw-r--r--sys/vm/vm_mmap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
index 99d5059..3d72123 100644
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -912,11 +912,18 @@ RestartScan:
vm_page_dirty(m);
if (m->dirty != 0)
mincoreinfo |= MINCORE_MODIFIED_OTHER;
- vm_page_lock_queues();
+ /*
+ * The first test for PG_REFERENCED is an
+ * optimization. The second test is
+ * required because a concurrent pmap
+ * operation could clear the last reference
+ * and set PG_REFERENCED before the call to
+ * pmap_is_referenced().
+ */
if ((m->flags & PG_REFERENCED) != 0 ||
- pmap_is_referenced(m))
+ pmap_is_referenced(m) ||
+ (m->flags & PG_REFERENCED) != 0)
mincoreinfo |= MINCORE_REFERENCED_OTHER;
- vm_page_unlock_queues();
}
if (object != NULL)
VM_OBJECT_UNLOCK(object);
OpenPOWER on IntegriCloud