Actually, I'd prefer a _stupider_ approach, which would be to get rid of
"tries" altogether, and instead do:
unsigned long start = jiffies;
do {
.. swapout ..
} while (jiffies == start);
which essentially throttles kswapd to run at most one jiffy (and that in
turn pretty much guarantees that kswapd at MOST can ever run 50% of the
time, which is pretty close to the kind of guarantee we want).
Could you try the above simple approach?
I really think that being simple should work. Anything complex I wouldn't
ever trust in all circumstances.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/