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
This commit is contained in:
Attilio Rao 2013-04-08 20:02:27 +00:00
parent bc403f030d
commit a15f7df5de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=249278
2 changed files with 5 additions and 5 deletions

View File

@ -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 */

View File

@ -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;
}