From cf382e5c12b32c18505aae9cc70391ddfa535227 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 21 Sep 2018 23:41:09 +0100 Subject: [PATCH] swap: fix a nasty little bug We checked against the wrong process for one case, that in turn meant a specific pattern of activity could mess up when it tried to swap out a zombie process --- Kernel/swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/swap.c b/Kernel/swap.c index c2c269c9..7e19b606 100644 --- a/Kernel/swap.c +++ b/Kernel/swap.c @@ -104,7 +104,7 @@ static ptptr swapvictim(ptptr p, int notself) if (c->p_status == P_READY) r = c; if (c->p_status > P_READY - && p->p_status <= P_FORKING) { + && c->p_status <= P_FORKING) { /* relative position in order of waits, bigger is longer, can wrap but shouldn't really matter to us much if it does */ s = (waitno - c->p_waitno); -- 2.34.1