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

From: David Rientjes
Date: Thu Jul 23 2009 - 19:29:23 EST


On Fri, 24 Jul 2009, KOSAKI Motohiro wrote:

> > It's the API that's existed for years with no complaints, AFAICS.
>
> I think thead and vfork() should be separeted on this discussion.
> I agree vfork() regression should be fixed. but I don't think anyone
> hope per-thread oom score.
>
> Of cource, if simple reverting is best way, I don't oppose this.... ;-)
>

Simply reverting it isn't an option unless you fix the underlying livelock
problem that my patches originally addressed and no viable alternative has
been proposed.

On the other hand, I think adding /proc/pid/oom_adj_child would solve the
userspace issue. oom_adj_child would be the oom_adj value that is used by
the newly initialized mm_struct; this would allow the vfork'd child to
share the same oom_score with the parent and then be replaced with an
alternate score on execve().

oom_adj_child would only be allowed to be greater (i.e. the more preferred
victim) than oom_adj for any given thread since the oom killer tries to
kill a child of the selected task first if it doesn't share memory.
--
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/