[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131108184515.GA11555@redhat.com>
Date: Fri, 8 Nov 2013 19:45:15 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Sameer Nanda <snanda@...omium.org>
Cc: akpm@...ux-foundation.org, mhocko@...e.cz, rientjes@...gle.com,
hannes@...xchg.org, rusty@...tcorp.com.au, semenzato@...gle.com,
murzin.v@...il.com, dserrg@...il.com, msb@...omium.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm, oom: Fix race when selecting process to kill
Sorry.
I didn't have time to answer other emails, will try to do later.
And yes, yes, while_each_thread() should be fixed, still on my
TODO list... But just in case, whatever we do with while_each_thread()
we should also fix some users.
Until then,
On 11/08, Sameer Nanda wrote:
>
> @@ -412,13 +412,16 @@ void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
> static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL,
> DEFAULT_RATELIMIT_BURST);
>
> + read_lock(&tasklist_lock);
> +
> /*
> * If the task is already exiting, don't alarm the sysadmin or kill
> * its children or threads, just set TIF_MEMDIE so it can die quickly
> */
> - if (p->flags & PF_EXITING) {
> + if (p->flags & PF_EXITING || !pid_alive(p)) {
OK.
> - read_lock(&tasklist_lock);
But you should also move read_unlock_down(), at least after
find_lock_task_mm().
And of course, this doesn't fix other users in oom_kill.c.
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