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
This commit is contained in:
alc 2017-12-31 21:36:42 +00:00
parent 5b5ae073d1
commit c4f7f60d06

View File

@ -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 @@ swapout_procs(int action)
goto nextproc;
}
if (minslptime > slptime)
minslptime = slptime;
thread_unlock(td);
}
@ -841,15 +838,11 @@ swapout_procs(int action)
* 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);