Cc: Rafael J. Wysocki <rjw@...>, Pierre Ossman <drzeus-mmc@...>, Zdenek Kabelac <zdenek.kabelac@...>, Kernel development list <linux-kernel@...>, pm list <linux-pm@...>
Subtle.
Very subtly wrong ;-).
imagine suspending_task == 0xabcdef01. Now task "R" with current ==
0xabcd0000 reads suspending_task while the other cpu is writing to it,
and sees 0xabcd0000 (0xef01 was not yet written) -- and mistakenly
believes that "R" == suspending_task.
I agree it is very unlikely, and it will not happen on i386. But what
about just using atomic_t suspending_task, and store current->pid into
it?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--