Author: attilio Date: Mon Apr 8 20:02:27 2013 New Revision: 249278 URL: http://svnweb.freebsd.org/changeset/base/249278
Log: The per-page act_count can be made very-easily protected by the per-page lock rather than vm_object lock, without any further overhead. Make the formal switch. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho Modified: head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Apr 8 19:58:32 2013 (r249277) +++ head/sys/vm/vm_page.h Mon Apr 8 20:02:27 2013 (r249278) @@ -143,7 +143,7 @@ struct vm_page { uint8_t aflags; /* access is atomic */ uint8_t oflags; /* page VPO_* flags (O) */ uint16_t flags; /* page PG_* flags (P) */ - u_char act_count; /* page usage count (O) */ + u_char act_count; /* page usage count (P) */ u_char busy; /* page busy count (O) */ /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Apr 8 19:58:32 2013 (r249277) +++ head/sys/vm/vm_pageout.c Mon Apr 8 20:02:27 2013 (r249278) @@ -1015,9 +1015,9 @@ vm_pageout_scan(int pass) } else if ((m->aflags & PGA_REFERENCED) == 0 && (actcount = pmap_ts_referenced(m)) != 0) { vm_page_activate(m); - vm_page_unlock(m); - m->act_count += actcount + ACT_ADVANCE; VM_OBJECT_WUNLOCK(object); + m->act_count += actcount + ACT_ADVANCE; + vm_page_unlock(m); goto relock_queues; } @@ -1031,9 +1031,9 @@ vm_pageout_scan(int pass) vm_page_aflag_clear(m, PGA_REFERENCED); actcount = pmap_ts_referenced(m); vm_page_activate(m); - vm_page_unlock(m); - m->act_count += actcount + ACT_ADVANCE + 1; VM_OBJECT_WUNLOCK(object); + m->act_count += actcount + ACT_ADVANCE + 1; + vm_page_unlock(m); goto relock_queues; } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"