summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2013-08-19 23:54:24 +0000
committerjeff <jeff@FreeBSD.org>2013-08-19 23:54:24 +0000
commit0b78e7c4d9e710538a93a46288bfe64b87eafb0e (patch)
treefd62cee620eb75ebaa42c7be9dfcc56cbe44455b /sys/vm
parented90d4ba3f00bfbe7c9b9e97e3ff953e3c682423 (diff)
downloadFreeBSD-src-0b78e7c4d9e710538a93a46288bfe64b87eafb0e.zip
FreeBSD-src-0b78e7c4d9e710538a93a46288bfe64b87eafb0e.tar.gz
- Increase the active lru refresh interval to 10 minutes. This has been
shown to negatively impact some workloads and the goal is only to eliminate worst case behaviors for very long periods of paging inactivity. Eventually we should determine a more complex scaling factor for this feature. - Rate limit low memory callback handlers to limit thrashing. Set the default to 10 seconds. Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_pageout.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index e63fcaa..472ae78 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -159,6 +159,8 @@ static int vm_max_launder = 32;
static int vm_pageout_update_period;
static int defer_swap_pageouts;
static int disable_swap_pageouts;
+static int lowmem_period = 10;
+static int lowmem_ticks;
#if defined(NO_SWAPPING)
static int vm_swap_enabled = 0;
@@ -179,6 +181,9 @@ SYSCTL_INT(_vm, OID_AUTO, pageout_update_period,
CTLFLAG_RW, &vm_pageout_update_period, 0,
"Maximum active LRU update period");
+SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RW, &lowmem_period, 0,
+ "Low memory callback period");
+
#if defined(NO_SWAPPING)
SYSCTL_INT(_vm, VM_SWAPPING_ENABLED, swap_enabled,
CTLFLAG_RD, &vm_swap_enabled, 0, "Enable entire process swapout");
@@ -901,9 +906,10 @@ vm_pageout_scan(struct vm_domain *vmd, int pass)
/*
* If we need to reclaim memory ask kernel caches to return
- * some.
+ * some. We rate limit to avoid thrashing.
*/
- if (pass > 0) {
+ if (vmd == &vm_dom[0] && pass > 0 &&
+ lowmem_ticks + (lowmem_period * hz) < ticks) {
/*
* Decrease registered cache sizes.
*/
@@ -913,6 +919,7 @@ vm_pageout_scan(struct vm_domain *vmd, int pass)
* drained above.
*/
uma_reclaim();
+ lowmem_ticks = ticks;
}
/*
@@ -1680,10 +1687,11 @@ vm_pageout(void)
/*
* Set interval in seconds for active scan. We want to visit each
- * page at least once a minute.
+ * page at least once every ten minutes. This is to prevent worst
+ * case paging behaviors with stale active LRU.
*/
if (vm_pageout_update_period == 0)
- vm_pageout_update_period = 60;
+ vm_pageout_update_period = 600;
/* XXX does not really belong here */
if (vm_page_max_wired == 0)
OpenPOWER on IntegriCloud