From: Alan Cox Date: Sun, 25 Nov 2018 01:41:20 +0000 (+0000) Subject: swap: fix case where we ended up self swapping when it's forbidden X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=ca2aedb2742acfe0e09c27eb608ccb5553dec03d;p=FUZIX.git swap: fix case where we ended up self swapping when it's forbidden If the only other processes you have in memory are running, and you have gone to sleep thus triggering your swapout then we would try and swap out the running process, which isn't supported (because we avoid the cost of a swapper process we pay that small cost here). --- diff --git a/Kernel/swap.c b/Kernel/swap.c index 7e19b606..f12fe965 100644 --- a/Kernel/swap.c +++ b/Kernel/swap.c @@ -99,7 +99,7 @@ static ptptr swapvictim(ptptr p, int notself) c = getproc_nextp; do { - if (c->p_page) { /* No point swapping someone in swap! */ + if (c->p_page && c != udata.u_ptab) { /* No point swapping someone in swap! */ /* Find the last entry before us */ if (c->p_status == P_READY) r = c;