[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1327591943.2446.111.camel@twins>
Date: Thu, 26 Jan 2012 16:32:23 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Ingo Molnar <mingo@...e.hu>, Yasunori Goto <y-goto@...fujitsu.com>,
Thomas Gleixner <tglx@...utronix.de>,
Hiroyuki KAMEZAWA <kamezawa.hiroyu@...fujitsu.com>,
Motohiro Kosaki <kosaki.motohiro@...fujitsu.com>,
Linux Kernel ML <linux-kernel@...r.kernel.org>
Subject: Re: [BUG] TASK_DEAD task is able to be woken up in special condition
On Wed, 2012-01-25 at 18:43 +0100, Oleg Nesterov wrote:
> And this time I do not understand your reply.
Hmm, I wouldn't either, I think I got ->on_cpu and ->on_rq confused. Let
me try again.
So since we never call schedule() the p->on_rq thing will always be
true. This means we don't need to consider all the icky ttwu after that,
it also means the whole thing is inside ->pi_lock.
So we only have to consider the exact case Yasunori-San illustrated, and
waiting on ->pi_lock is sufficient.
However I think your proposal:
> for (;;) {
> tsk->state = TASK_DEAD;
> schedule();
> }
should equally work, if we hit the race and call schedule() with ->state
= TASK_RUNNING, we'll simply loop and try again observing the TASK_DEAD
on the second+ go.
Now I prefer your solution since it doesn't add anything to the exit
path.
--
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