svn commit: r327450 - head/sys/vm

Alan Cox alc at FreeBSD.org
Sun Dec 31 21:36:44 UTC 2017


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);


More information about the svn-src-head mailing list