Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Dec 2017 21:36:42 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327450 - head/sys/vm
Message-ID:  <201712312136.vBVLagVG055312@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Dec 31 21:36:42 2017
New Revision: 327450
URL: https://svnweb.freebsd.org/changeset/base/327450

Log:
  The variable "minslptime" is pointless and always has been, ever since its
  introduction in r83366.  (At that time, this code appeared in vm/vm_glue.c,
  because vm/vm_swapout.c did not exist.)  When the FOREACH_THREAD loop
  completes, we know that the sleep time for every thread is above whichever
  threshold is being applied.
  
  Reviewed by:	kib
  X-MFC with:	r327354

Modified:
  head/sys/vm/vm_swapout.c

Modified: head/sys/vm/vm_swapout.c
==============================================================================
--- head/sys/vm/vm_swapout.c	Sun Dec 31 21:29:20 2017	(r327449)
+++ head/sys/vm/vm_swapout.c	Sun Dec 31 21:36:42 2017	(r327450)
@@ -729,10 +729,9 @@ swapout_procs(int action)
 {
 	struct proc *p;
 	struct thread *td;
-	int minslptime, slptime;
+	int slptime;
 	bool didswap;
 
-	minslptime = 100000;
 	didswap = false;
 retry:
 	sx_slock(&allproc_lock);
@@ -831,8 +830,6 @@ retry:
 					goto nextproc;
 				}
 
-				if (minslptime > slptime)
-					minslptime = slptime;
 				thread_unlock(td);
 			}
 
@@ -841,15 +838,11 @@ retry:
 			 * or if this process is idle and the system is
 			 * configured to swap proactively, swap it out.
 			 */
-			if ((action & VM_SWAP_NORMAL) != 0 ||
-			    ((action & VM_SWAP_IDLE) != 0 &&
-			    minslptime > swap_idle_threshold2)) {
-				_PRELE(p);
-				if (swapout(p) == 0)
-					didswap = true;
-				PROC_UNLOCK(p);
-				goto retry;
-			}
+			_PRELE(p);
+			if (swapout(p) == 0)
+				didswap = true;
+			PROC_UNLOCK(p);
+			goto retry;
 		}
 nextproc:
 		PROC_UNLOCK(p);



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