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

From: KOSAKI Motohiro
Date: Thu Jul 23 2009 - 21:10:36 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.

I disagree.
I agree with old behavior have one bug. but it doesn't provide any regression
allowing reason although old behavior is totally suck.

David, We already know your patch break real application. it is never acceptable.


> 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().

Not solve. "please rewrite your application" isn't good solution.

Hm...
This is just idea, Does moving oom_adj from mm_struct to signal_struct solve
this problem?
I mean vfork() share mm_struct, but doesn't share signal_struct.




>
> 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/