[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110830152856.GA22754@redhat.com>
Date: Tue, 30 Aug 2011 17:28:56 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: David Rientjes <rientjes@...gle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Ying Han <yinghan@...gle.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [patch 1/2] oom: remove oom_disable_count
On 08/30, David Rientjes wrote:
>
> This removes mm->oom_disable_count entirely since it's unnecessary and
> currently buggy. The counter was intended to be per-process but it's
> currently decremented in the exit path for each thread that exits, causing
> it to underflow.
>
> The count was originally intended to prevent oom killing threads that
> share memory with threads that cannot be killed since it doesn't lead to
> future memory freeing. The counter could be fixed to represent all
> threads sharing the same mm, but it's better to remove the count since:
>
> - it is possible that the OOM_DISABLE thread sharing memory with the
> victim is waiting on that thread to exit and will actually cause
> future memory freeing, and
>
> - there is no guarantee that a thread is disabled from oom killing just
> because another thread sharing its mm is oom disabled.
Great, thanks.
Even _if_ (I hope not) we decide to re-introduce this counter later,
I think it will be much more simple to start from the very beginning
and make the correct patch.
> @@ -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)
> + 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.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists