swap: set inswap flag on swapping out
authorAlan Cox <alan@linux.intel.com>
Sun, 2 Dec 2018 23:45:08 +0000 (23:45 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 2 Dec 2018 23:45:08 +0000 (23:45 +0000)
Kernel/swap.c

index f12fe96..3b3bca0 100644 (file)
@@ -144,9 +144,12 @@ static ptptr swapvictim(ptptr p, int notself)
 ptptr swapneeded(ptptr p, int notself)
 {
        ptptr n = swapvictim(p, notself);
-       if (n)
+       if (n) {
+               inswap = 1;
                if (swapout(n))
                        n = NULL;
+               inswap = 0;
+       }
        return n;
 }