Re: [PATCH 09/11] job control: reorganize wait_task_stopped()

From: Tejun Heo
Date: Fri May 13 2011 - 04:46:21 EST


Hello,

On Thu, May 12, 2011 at 08:33:26PM +0200, Oleg Nesterov wrote:
> Damn, you are right, I think.

Yay, for once!

> At first glance, do_wait() does
>
> wait_task_stopped();
> wait_task_continued();
>
> and the state can be changed CONTINIUED -> STOPPED in between, right?
> Or something else?

Yeah and exit transitions too. There simply is no synchronization
there. We can probably solve it without acquiring siglock by adding
"clear this before making state transitions" flag followed by a mb()
and then making children clear it before transitions. Then, we can
retry WNOHANG wait if the flag is cleared after checking.

Thanks.

--
tejun
--
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/