Re: [PATCH] Remove OOM killer from try_to_free_pages / all_unreclaimable braindamage

Werner Almesberger
2004-11-18T10:02:23Z

Chris Ross wrote:
> All I'm advocating is just swapping something out if possible
> instead.

Yes, but this only works if a) your system can make progress
towards lowering its memory needs without the process(es) you've
picked for swapping, and b) these processes don't happen to be
something that cannot tolerate long suspension, and c) the total
memory needs are such that they can be better satisfied after
these processes have been swapped out.

Examples where this isn't the case: a) if you swap out your
hoursekeeping cron job, the system will just sit idle, then you
swap it in again after a few minutes, and the agony repeats.
b) if you swap out my X server while I'm sitting at the machine,
all you've done was to force me to press the big red switch
manually. c) if there's a process with excessive memory demands
that can't be met anyway, it's better to end its misery quickly,
instead of spending a day thrashing.

So again, your automatic OOM kill^H^H^H^Hcounsellor doesn't only
have to follow a fixed policy, but it also has to sense what kind
of situation we're in.

A SIGSWAP would help with a) and b). In case a), the cron jobs
would signal anything that's not them. In case b), by definition,
I'd not be working when this happens. This can be assisted by
user detection heuristics as used in some batch distribution
systems. (Now we have a fairly complex user space already, with
lots of policy.) The usual "runaway process" heuristics can
probably take care of c).

> Too often at present the machine just doesn't know what to do,

See, that's exactly what I mean :-) So, why not just tell it ?
"Hey, things are going to get a little rough for a while. Why
don't you take a nap on that comfty swap disk while I clean up
the house ?"

> [ * I just looked it up: "of, relating to, or resembling the mental or
> emotional state believed induced by the god Pan". Cool ]

Hmm, you're suggesting we follow Morpheus instead of Pan then ?
And I always thought the OOM killer was more like Eris' work :-)

- Werner

--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/