On Thu, Aug 16, 2007 at 06:42:50PM +0800, Herbert Xu wrote:
The compiler can also reorder non-volatile accesses. For an example
patch that cares about this, please see:
http://lkml.org/lkml/2007/8/7/280
This patch uses an ORDERED_WRT_IRQ() in rcu_read_lock() and
rcu_read_unlock() to ensure that accesses aren't reordered with respect
to interrupt handlers and NMIs/SMIs running on that same CPU.
Absolutely disagree. An interrupt/NMI/SMI handler running on the CPU
will see the same value (whether in cache or in store buffer) that
the mainline code will see. In this case, we don't care about CPU
misordering, only about compiler misordering. It is easy to see
other uses that combine communication with handlers on the current
CPU with communication among CPUs -- again, see prior messages in
this thread.
Precisely. And volatility is a key property of "atomic". Let's please
not throw it away.
Thanx, Paul
-