From: Paul E. McKenney Date: Tue, 12 Aug 2014 20:54:21 +0000 (-0700) Subject: rcu: Avoid misordering in nocb_leader_wait() X-Git-Tag: fixes-against-v3.18-rc2~103^2~1^2~16^3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c847f14217d5aec5336272a54a32ffcf6e06ddcb;p=pandora-kernel.git rcu: Avoid misordering in nocb_leader_wait() The NOCB follower wakeup ordering depends on the store to the tail pointer happening before the wakeup. However, because atomic_long_add() does not return a value, it does not provide ordering guarantees, and the locking in wake_up() only guarantees that the store will happen before the unlock, which might be too late. Even though this is only a theoretical issue, this commit adds a smp_mb__after_atomic() after the final atomic_long_add() to provide the needed ordering guarantee. Reported-by: Amit Shah Signed-off-by: Paul E. McKenney Tested-by: Paul Gortmaker --- Reading git-diff-tree failed