Re: [PATCH] Immunize rcu_dereference() against crazy compiler writers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Paul E. McKenney" <[email protected]> writes:

> Turns out that compiler writers are a bit more aggressive about optimizing
> than one might expect.  This patch prevents a number of such optimizations
> from messing up rcu_deference().  This is not merely a theoretical
> problem, as evidenced by the rmb() in mce_log().

Don't think that's an improvement. rmb() at least is known to work
reliable to prevent such reordering. Memory barriers are well
documented in the gcc documentation. Who knows about volatile?  The
volatile semantics have been traditionally unclear and shakey.
The C standard doesn't make much guarantees and i don't think 
gcc does either.

If anything you might want to embedd rmb(); in a statement expression
in rcu_deference instead.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux