Re: Linux behaviour in low memory situations.

Bill Hawes (whawes@star.net)
Mon, 20 Jul 1998 09:25:59 -0400


Andrea Arcangeli wrote:

> If you have allocated more virtual memory than ram (so you _need_ the
> swap) and you run swapoff -a, the machine continue to deadlock as usual
> (you reminded me to try that ;-).
>
> I developed a patch for the swapoff thing. I don' t know if this is the
> right patch (probably it isn' t) but at least fix things well. The problem
> was the kswapd was running all the time in FIFO scheduler. So I stopped it
> before swapoff ;-).

The problem with kswapd looping forever during a swapoff does need to be
fixed, but turning off kswapd isn't really the right way to do it. You
_want_ the swapper to run during swapoff -- that way it can redistribute
memory that was previously swapped out.

If there are other swap partitions, those could pick up the slack for
the one being turned off. Or possibly there's enough system memory now
so that the swap isn't needed, in which case kswapd can move memory from
page or buffer cache.

The swapoff operation used to fail cleanly when there wasn't enough
memory, when an attempted get_free_page() failed. It seems like the
current swap policy is trying too hard and goes into an infinite loop
rather than let an allocation fail.

Perhaps what we need is a way for kswapd to realize that it can't get
any more memory and give up until the next swapper tick ...

Regards,
Bill

-
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.altern.org/andrebalsa/doc/lkml-faq.html