Re: out_of_memory() heuristic broken for different mem configurations

Linus Torvalds (torvalds@transmeta.com)
Thu, 8 Nov 2001 09:00:27 -0800 (PST)


On Thu, 8 Nov 2001, Marcelo Tosatti wrote:
>
> I remember Linus had a reasoning for the "scan _ALL_ ptes until success"
> behaviour.
>
> Linus, was that due to zone-specific (eg DMA shortage on bigmem machine)
> shortages or ?

No, the major reason simply _is_ because it's fairly easy to come up with
test-cases that are mostly MAP_SHARED, and are not out-of-memory.
Returning early from swap_out() is simply fundamentally wrong - whether we
have free swap-space or not has very little to do with anything.

(Well, whether we have free swap space or not _is_ meaningful once we have
scanned all VM's, but not before that).

But see my suggestion about potentially noticing the oom _before_ calling
swap_out(). Thanks to anonymous-in-LRU we have a _lot_ of powerful
information that we simply traditionally haven't had. It doesn't just tell
us when we should start swapping out, it can also tell us if swap-out is
going to need swap-space or not. It can even tell how _much_ swap-space
we'll need to satisfy the "free N pages from the VM".

> However, the current code breaks badly as I've tested on the 16GB boxen.

I understand. I just think the fix needs to be different.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/