summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2015-09-20 19:20:03 +0000
committerAlan Cox <alc@FreeBSD.org>2015-09-20 19:20:03 +0000
commitd9347bca9a4ac7e72fe303de009b910af1324153 (patch)
tree2fbf814e246a1f70e7c5146bab44e4a5ad1a1d3d
parent715a136ddfbaeed3667749c61928ab79a8020c28 (diff)
Notes
-rw-r--r--sys/vm/vm_pageout.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 664119391cd98..0a18e6db68931 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1638,9 +1638,15 @@ vm_pageout_worker(void *arg)
}
if (vm_pages_needed) {
/*
- * Still not done, take a second pass without waiting
- * (unlimited dirty cleaning), otherwise sleep a bit
- * and try again.
+ * We're still not done. Either vm_pages_needed was
+ * set by another thread during the previous scan
+ * (typically, this happens during a level 0 scan) or
+ * vm_pages_needed was already set and the scan failed
+ * to free enough pages. If we haven't yet performed
+ * a level >= 2 scan (unlimited dirty cleaning), then
+ * upgrade the level and scan again now. Otherwise,
+ * sleep a bit and try again later. While sleeping,
+ * vm_pages_needed can be cleared.
*/
if (domain->vmd_pass > 1)
msleep(&vm_pages_needed,
@@ -1651,15 +1657,14 @@ vm_pageout_worker(void *arg)
* Good enough, sleep until required to refresh
* stats.
*/
- domain->vmd_pass = 0;
msleep(&vm_pages_needed, &vm_page_queue_free_mtx,
PVM, "psleep", hz);
-
}
if (vm_pages_needed) {
vm_cnt.v_pdwakeups++;
domain->vmd_pass++;
- }
+ } else
+ domain->vmd_pass = 0;
mtx_unlock(&vm_page_queue_free_mtx);
vm_pageout_scan(domain, domain->vmd_pass);
}