Re: [PATCH] copy over oom_adj value at fork time

From: David Rientjes
Date: Tue Jul 14 2009 - 23:49:23 EST


On Tue, 14 Jul 2009, Paul Menage wrote:

> But ironically, with this fix applied the main part of the original
> change (force all threads in a process to share a single oom_adj
> value) will start to break my code - it's no longer possible to have
> the regular threads in a process be oom-immune, then vfork() and set a
> non-disabled oom_adj in the child, since this will set it for the
> entire process.

My patch to make oom_adj be a characteristic of the mm_struct and not the
task_struct makes it consistent, the scenario you describe above would
still have an OOM_DISABLE'd child even though /proc/pid-of-child/oom_adj
is not. That's the bug my patch addressed.

Without my change, the oom killer will endlessly loop if the child and not
the parent is chosen to be killed because parent->mm->oom_adj ==
OOM_DISABLE. The inheritance property is secondary to the semantics of
oom_adj and should be fixed with Rik's patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/