lkml.org 
[lkml]   [2011]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] oom: skip frozen tasks
On Fri, 26 Aug 2011, Michal Hocko wrote:

> > I do like the idea of automatically thawing the task though and if that's
> > possible then I don't think we need to manipulate the badness heuristic at
> > all. I know that wouldn't be feasible when we've frozen _all_ threads and
>
> Why it wouldn't be feasible for all threads? If you have all tasks
> frozen (suspend going on, whole cgroup or all tasks in a cpuset/nodemask
> are frozen) then the selection is more natural because all of them are
> equal (with or without a bonus). The bonus tries to reduce thawing if
> not all of them are frozen.

Yeah, this comment wasn't in reference to your heuristic change, it was in
reference to the fact that if all threads are frozen then there is little
hope for us recovering from the situation without a user response. I
think that's why we want oom_killer_disable() so that we avoid looping
forever and can actually fail allocations in the hope that we'll bring
ourselves out of suspend.

> I am not saying the bonus is necessary, though. It depends on what
> the freezer is used for (e.g. freeze a process which went wild and
> debug what went wrong wouldn't welcome that somebody killed it or other
> (mis)use which relies on D state).
>

I'd love to be able to do a thaw on a PF_FROZEN task in the oom killer
followed by a SIGKILL if that task is selected for oom kill without an
heuristic change. Not sure if that's possible, so we'll wait for Rafael
to chime in.

If it actually does come down to a heuristic change, then it need not
happen in the oom killer: the freezing code would need to use
test_set_oom_score_adj() to temporarily reduce the oom_score_adj for that
task until it comes out of the refrigerator. We already use that in ksm
and swapoff to actually prefer threads, but we can use it to bias against
threads as well.


\
 
 \ /
  Last update: 2011-08-26 20:15    [W:0.091 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site