Re: [patch 1/2] oom: remove oom_disable_count

From: David Rientjes
Date: Tue Aug 30 2011 - 18:07:00 EST


On Tue, 30 Aug 2011, Oleg Nesterov wrote:

> > @@ -447,6 +431,9 @@ static int oom_kill_task(struct task_struct *p, struct mem_cgroup *mem)
> > for_each_process(q)
> > if (q->mm == mm && !same_thread_group(q, p) &&
> > !(q->flags & PF_KTHREAD)) {
>
> (I guess this is on top of -mm patch)
>

Yes, it's based on
oom-avoid-killing-kthreads-if-they-assume-the-oom-killed-threads-mm.patch
which I thought would be pushed for the 3.1 rc series, we certainly don't
want to SIGKILL kthreads :)

> > + if (q->signal->oom_score_adj == OOM_SCORE_ADJ_MIN)
> > + continue;
> > +
>
> Afaics, this is the only change apart from "removes mm->oom_disable_count
> entirely", looks reasonable to me.
>

Yeah, it's necessary because this loop in oom_kill_task() kills all
user threads in different thread groups unconditionally if they share the
same mm, so we need to ensure that we aren't sending a SIGKILL to anything
that is actually oom disabled. Before, the check in oom_badness() would
have prevented the task (`p' in this function) from being chosen in the
first place.
--
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/