diff options
author | alc <alc@FreeBSD.org> | 2010-07-02 20:56:22 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2010-07-02 20:56:22 +0000 |
commit | 99b0e7f96be9911eab00cbf26b2f728f18180c19 (patch) | |
tree | b86826f5364505eda05ed56900bcf3dc619eca74 /sys/vm | |
parent | 3e4ac0b6ee6ec8f80da577692259abc26fbf1b17 (diff) | |
download | FreeBSD-src-99b0e7f96be9911eab00cbf26b2f728f18180c19.zip FreeBSD-src-99b0e7f96be9911eab00cbf26b2f728f18180c19.tar.gz |
Push down the acquisition of the page queues lock into
vm_pageout_page_stats(). In particular, avoid acquiring the page
queues lock unless iterating over the active queue.
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_pageout.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index d664938..f4109c1 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1355,7 +1355,6 @@ vm_pageout_page_stats() static int fullintervalcount = 0; int page_shortage; - mtx_assert(&vm_page_queue_mtx, MA_OWNED); page_shortage = (cnt.v_inactive_target + cnt.v_cache_max + cnt.v_free_min) - (cnt.v_free_count + cnt.v_inactive_count + cnt.v_cache_count); @@ -1363,6 +1362,7 @@ vm_pageout_page_stats() if (page_shortage <= 0) return; + vm_page_lock_queues(); pcount = cnt.v_active_count; fullintervalcount += vm_pageout_stats_interval; if (fullintervalcount < vm_pageout_full_stats_interval) { @@ -1448,6 +1448,7 @@ vm_pageout_page_stats() VM_OBJECT_UNLOCK(object); m = next; } + vm_page_unlock_queues(); } /* @@ -1569,9 +1570,7 @@ vm_pageout() if (error && !vm_pages_needed) { mtx_unlock(&vm_page_queue_free_mtx); pass = 0; - vm_page_lock_queues(); vm_pageout_page_stats(); - vm_page_unlock_queues(); continue; } } |