Date: Thu, 27 Oct 2016 00:08:02 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r307980 - user/alc/PQ_LAUNDRY/sys/vm Message-ID: <201610270008.u9R082KT088369@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Thu Oct 27 00:08:02 2016 New Revision: 307980 URL: https://svnweb.freebsd.org/changeset/base/307980 Log: Use a defined constant for the pagedaemon's sleep interval. Reviewed by: alc Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Oct 26 23:40:07 2016 (r307979) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Thu Oct 27 00:08:02 2016 (r307980) @@ -154,11 +154,9 @@ static struct kproc_desc vm_kp = { SYSINIT(vmdaemon, SI_SUB_KTHREAD_VM, SI_ORDER_FIRST, kproc_start, &vm_kp); #endif -/* Sleep intervals for pagedaemon threads, in subdivisions of one second. */ -#define VM_LAUNDER_INTERVAL 10 -#define VM_INACT_SCAN_INTERVAL 2 - -#define VM_LAUNDER_RATE (VM_LAUNDER_INTERVAL / VM_INACT_SCAN_INTERVAL) +/* Pagedaemon activity rates, in subdivisions of one second. */ +#define VM_LAUNDER_RATE 10 +#define VM_INACT_SCAN_RATE 2 int vm_pageout_deficit; /* Estimated number of pages deficit */ u_int vm_pageout_wakeup_thresh; @@ -1148,7 +1146,7 @@ vm_pageout_laundry_worker(void *arg) */ if (shortfall > 0) { in_shortfall = true; - shortfall_cycle = VM_LAUNDER_RATE; + shortfall_cycle = VM_LAUNDER_RATE / VM_INACT_SCAN_RATE; target = shortfall; } else if (!in_shortfall) goto trybackground; @@ -1210,7 +1208,7 @@ trybackground: target = 0; } launder = vm_background_launder_rate * PAGE_SIZE / 1024; - launder /= VM_LAUNDER_INTERVAL; + launder /= VM_LAUNDER_RATE; if (launder > target) launder = target; } @@ -1224,7 +1222,7 @@ dolaundry: */ target -= min(vm_pageout_launder(domain, launder, in_shortfall), target); - pause("laundp", hz / VM_LAUNDER_INTERVAL); + pause("laundp", hz / VM_LAUNDER_RATE); } /* @@ -1975,7 +1973,7 @@ vm_pageout_worker(void *arg) */ mtx_unlock(&vm_page_queue_free_mtx); if (pass >= 1) - pause("psleep", hz / 2); + pause("psleep", hz / VM_INACT_SCAN_RATE); pass++; } else { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610270008.u9R082KT088369>