From 13f9812e39edafb011d1e001815740145e49fde3 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Tue, 22 Sep 2015 12:34:53 +0200 Subject: [PATCH 163/257] sys/vm: vm_pageout_scan: Stop pass after reaching the "maximum" value ... explicitly understood by vm_pageout_scan(). Should prevent (purely cosmetic) issues like: fk@r500 ~ $sudo /usr/src/share/dtrace/monitor-page-scanner [...] 2015 Sep 22 12:15:54: Scan goal 59: Invalid 2015 Sep 22 12:15:54: Scan goal 60: Invalid 2015 Sep 22 12:15:55: Scan goal 61: Invalid 2015 Sep 22 12:15:55: Scan goal 62: Invalid 2015 Sep 22 12:15:55: Scan goals in the previous minute: Launder dirty pages 1 Pageout dirty pages 1 Move inactive to cache or free 2 Invalid 5 Update active LRU/deactivate pages 28 2015 Sep 22 12:15:55: Seconds since last 'Move inactive to cache or free' pass: 30 2015 Sep 22 12:15:55: Seconds since last 'Launder dirty pages' pass: 30 2015 Sep 22 12:15:55: Seconds since last 'Pageout dirty pages' pass: 30 Obtained from: ElectroBSD --- sys/vm/vm_pageout.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index a3f8774c9160..67cf415d2e1e 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -839,6 +839,7 @@ unlock_mp: return (error); } +#define VMD_PASS_MAX 3 /* * vm_pageout_scan does the dirty work for the pageout daemon. * @@ -861,6 +862,9 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) int starting_page_shortage, vnodes_skipped; boolean_t pageout_ok, queue_locked; + KASSERT(pass <= VMD_PASS_MAX, + ("vm_pageout_scan: Invalid pass code %d", pass)); + /* * If we need to reclaim memory ask kernel caches to return * some. We rate limit to avoid thrashing. @@ -1577,7 +1581,8 @@ vm_pageout_worker(void *arg) mtx_unlock(&vm_page_queue_free_mtx); if (pass > 1) pause("psleep", hz / 2); - pass++; + if (pass < VMD_PASS_MAX) + pass++; } else { /* * Yes. Sleep until pages need to be reclaimed or -- 2.11.0