Re: [ANNOUNCE] Kernel Janitor's TODO list

Andrea Arcangeli
2001-02-16T14:29:25Z

On Mon, Jan 29, 2001 at 09:35:53PM +0100, Andi Kleen wrote:
> On Mon, Jan 29, 2001 at 08:47:50PM +0100, Roman Zippel wrote:
> > You still miss wakeups. :)
>
> And there was another race in it, I know. The first __set_task_state
> has to be set_task_state to get the right memory write order on SMP.

If the wakeup is serialized by the spinlock too (as your code looks like to
assume) you can legally use __set_task_state instead of set_task_state. An
example of such an usage (where wakeup is serialized by the spinlock) is
lock_sock/unlock_sock.

Andrea