Re: JRCU Theory of Operation
From: Josh Triplett
Date: Sun Mar 13 2011 - 20:58:14 EST
On Sun, Mar 13, 2011 at 05:50:52PM -0700, Paul E. McKenney wrote:
> On Sun, Mar 13, 2011 at 07:53:51PM -0400, Joe Korty wrote:
> > But, there is a hint in current behavior. It is well known
> > that many multithreaded apps don't uses barriers at all;
> > the authors had no idea what they are for. Yet such apps
> > largely work. This implies that the chip designers are
> > very aggressive in doing implied memory barriers wherever
> > possible, and they are very aggressive in pushing out
> > stores to caches very quickly even when memory barriers,
> > implied or not, are not present.
>
> Ahem. Or that many barrier-omission failures have a low probability
> of occurring. One case in point is a bug in RCU a few years back,
> where ten-hour rcutorture runs produced only a handful of errors (see
> http://paulmck.livejournal.com/14639.html). Other cases are turned up by
> Peter Sewell's work, which tests code sequences with and without memory
> barriers (http://www.cl.cam.ac.uk/~pes20/). In many cases, broken code
> sequences have failure rates in the parts per billion.
And for that matter, locking primitives tend to necessarily imply
barriers (what good does a lock do if the memory accesses can leak out
of it), and the vast majority of multithreaded code uses locking. So,
most multithreaded apps implictly get all the barriers they require.
- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/