[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1002161357170.23037@chino.kir.corp.google.com>
Date: Tue, 16 Feb 2010 14:03:10 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Minchan Kim <minchan.kim@...il.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Nick Piggin <npiggin@...e.de>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH -mm] Kill existing current task quickly
On Wed, 17 Feb 2010, Minchan Kim wrote:
> If we found current task is existing but didn't set TIF_MEMDIE
> during OOM victim selection, let's stop unnecessary looping for
> getting high badness score task and go ahead for killing current.
>
> This patch would make side effect skip OOM_DISABLE test.
> But It's okay since the task is existing and oom_kill_process
> doesn't show any killing message since __oom_kill_task will
> interrupt it in oom_kill_process.
>
> Signed-off-by: Minchan Kim <minchan.kim@...il.com>
> Cc: Nick Piggin <npiggin@...e.de>
> ---
> mm/oom_kill.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/mm/oom_kill.c b/mm/oom_kill.c
> index 3618be3..5c21398 100644
> --- a/mm/oom_kill.c
> +++ b/mm/oom_kill.c
> @@ -295,6 +295,7 @@ static struct task_struct
> *select_bad_process(unsigned long *ppoints,
>
> chosen = p;
> *ppoints = ULONG_MAX;
> + break;
> }
>
> if (p->signal->oom_adj == OOM_DISABLE)
No, we don't want to break because there may be other candidate tasks that
have TIF_MEMDIE set that will be detected if we keep scanning. Returning
ERR_PTR(-1UL) from select_bad_process() has a special meaning: it means we
return to the page allocator without doing anything. We don't want more
than one candidate task to ever have TIF_MEMDIE at a time, otherwise they
can deplete all memory reserves and not make any forward progress. So we
always have to iterate the entire tasklist unless we find an already oom
killed task with access to memory reserves (to prevent needlessly killing
additional tasks before the first had a chance to exit and free its
memory) or a different candidate task is exiting so we'll be freeing
memory shortly (or it will be invoking the oom killer itself as current
and then get chosen as the victim).
--
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