Files
erofs-linux/kernel
Oleg Nesterov bc9560155f sched/completion: Serialize completion_done() with complete()
Commit de30ec4730 "Remove unnecessary ->wait.lock serialization when
reading completion state" was not correct, without lock/unlock the code
like stop_machine_from_inactive_cpu()

	while (!completion_done())
		cpu_relax();

can return before complete() finishes its spin_unlock() which writes to
this memory. And spin_unlock_wait().

While at it, change try_wait_for_completion() to use READ_ONCE().

Reported-by: Paul E. McKenney <[email protected]>
Reported-by: Davidlohr Bueso <[email protected]>
Tested-by: Paul E. McKenney <[email protected]>
Signed-off-by: Oleg Nesterov <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
[ Added a comment with the barrier. ]
Cc: Linus Torvalds <[email protected]>
Cc: Nicholas Mc Guire <[email protected]>
Cc: [email protected]
Cc: [email protected]
Fixes: de30ec4730 ("sched/completion: Remove unnecessary ->wait.lock serialization when reading completion state")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
2015-02-18 14:27:40 +01:00
..
2014-10-09 22:26:04 -04:00
2014-10-09 22:26:04 -04:00
2014-09-23 16:37:51 -04:00
…
…
…
…
…
…
…
…
…
2014-12-04 14:34:54 -05:00
…
2014-12-10 17:41:10 -08:00
…
2015-01-17 10:02:23 +13:00
…
…
2014-12-10 17:41:10 -08:00
2014-11-19 13:01:25 -05:00
…
…
…