[lkml]   [1998]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Linux behaviour in low memory situations.
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 ...


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:43    [W:0.052 / U:5.464 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site