From a9d505a22a9d9d343bf6874e995b921ad977453c Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 6 Sep 2011 10:30:11 +0000 Subject: Split the vm_page flags PG_WRITEABLE and PG_REFERENCED into atomic flags field. Updates to the atomic flags are performed using the atomic ops on the containing word, do not require any vm lock to be held, and are non-blocking. The vm_page_aflag_set(9) and vm_page_aflag_clear(9) functions are provided to modify afalgs. Document the changes to flags field to only require the page lock. Introduce vm_page_reference(9) function to provide a stable KPI and KBI for filesystems like tmpfs and zfs which need to mark a page as referenced. Reviewed by: alc, attilio Tested by: marius, flo (sparc64); andreast (powerpc, powerpc64) Approved by: re (bz) --- sys/vm/vm_object.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sys/vm/vm_object.c') diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 602d99e..3de793b 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1098,9 +1098,7 @@ shadowlookup: * sleeping so that the page daemon is less * likely to reclaim it. */ - vm_page_lock_queues(); - vm_page_flag_set(m, PG_REFERENCED); - vm_page_unlock_queues(); + vm_page_aflag_set(m, PGA_REFERENCED); } vm_page_unlock(m); if (object != tobject) -- cgit v1.1