Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Sep 2015 17:09:04 +0000 (UTC)
From:      Ryan Stone <rstone@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r287922 - stable/10/sys/vm
Message-ID:  <201509171709.t8HH94Im091953@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rstone
Date: Thu Sep 17 17:09:03 2015
New Revision: 287922
URL: https://svnweb.freebsd.org/changeset/base/287922

Log:
  MFC r286970:
  
    Prevent ticks rollover from preventing vm_lowmem event
  
    Currently vm_pageout_scan() uses a ticks-based scheme to rate-limit
    the number of times that the vm_lowmem event will happen.  However
    if no events happen for long enough for ticks to roll over, this
    leaves us in a long window in which vm_lowmem events will not
    happen.
  
    Replace the use of ticks with time_t to prevent rollover from ever
    being an issue.
  
    Reviewed by:  ian
    MFC after:    3 weeks
    Sponsored by: EMC / Isilon Storage Division
    Differential Revision:        https://reviews.freebsd.org/D3439

Modified:
  stable/10/sys/vm/vm_pageout.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/vm/vm_pageout.c
==============================================================================
--- stable/10/sys/vm/vm_pageout.c	Thu Sep 17 17:00:36 2015	(r287921)
+++ stable/10/sys/vm/vm_pageout.c	Thu Sep 17 17:09:03 2015	(r287922)
@@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/sdt.h>
 #include <sys/signalvar.h>
 #include <sys/smp.h>
+#include <sys/time.h>
 #include <sys/vnode.h>
 #include <sys/vmmeter.h>
 #include <sys/rwlock.h>
@@ -170,7 +171,7 @@ 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;
+static time_t lowmem_uptime;
 
 #if defined(NO_SWAPPING)
 static int vm_swap_enabled = 0;
@@ -932,7 +933,7 @@ vm_pageout_scan(struct vm_domain *vmd, i
 	 * some.  We rate limit to avoid thrashing.
 	 */
 	if (vmd == &vm_dom[0] && pass > 0 &&
-	    (ticks - lowmem_ticks) / hz >= lowmem_period) {
+	    (time_uptime - lowmem_uptime) >= lowmem_period) {
 		/*
 		 * Decrease registered cache sizes.
 		 */
@@ -943,7 +944,7 @@ vm_pageout_scan(struct vm_domain *vmd, i
 		 * drained above.
 		 */
 		uma_reclaim();
-		lowmem_ticks = ticks;
+		lowmem_uptime = time_uptime;
 	}
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509171709.t8HH94Im091953>