Re: [PATCH v3] oom-kill: add lowmem usage aware oom kill handling

From: David Rientjes
Date: Sat Jan 30 2010 - 17:54:04 EST

On Sat, 30 Jan 2010, Vedran Furac wrote:

> > The oom killer has been doing this for years and I haven't noticed a huge
> > surge in complaints about it killing X specifically because of that code
> > in oom_kill_process().
> Well you said it yourself, you won't see a surge because "oom killer has
> been doing this *for years*". So you'll have a more/less constant number
> of complains over the years. Just google for: linux, random, kill, memory;

You snipped the code segment where I demonstrated that the selected task
for oom kill is not necessarily the one chosen to die: if there is a child
with disjoint memory that is killable, it will be selected instead. If
Xorg or sshd is being chosen for kill, then you should investigate why
that is, but there is nothing random about how the oom killer chooses
tasks to kill.

The facts that you're completely ignoring are that changing the heuristic
baseline to rss is not going to prevent Xorg or sshd from being selected
(in fact, I even showed that it makes Xorg _more_ preferrable when I
reviewed the patch), and you have complete power of disabling oom killing
for selected tasks and that trait is inheritable to children.

I agree that we can do a better job than needlessly killing innocent tasks
when we have a lowmem oom. I suggested killing current in such a scenario
since ZONE_DMA memory was not reclaimable (and, soon, not migratable) and
all memory is pinned for such purposes. However, saying we need to change
the baseline for that particular case and completely misinterpret the
oom_adj values for all system-wide tasks is simply not an option. And
when that point is raised, it doesn't help for people to take their ball
and go home if their motivation is to improve the oom killer.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at