Re: Linus rollup

Andrea Arcangeli
2003-01-30T02:06:58Z

On Wed, Jan 29, 2003 at 05:52:32PM -0800, Richard Henderson wrote:
> On Wed, Jan 29, 2003 at 06:00:54PM -0800, Andrew Morton wrote:
> > Andrea Arcangeli <andrea@suse.de> wrote:
> > > if we hold the spinlock, the serialized memory can't be change under us,
> > > so there's no need to put a read barrier, we only care that pre_sequence
> > > is visible before the chagnes are visible and before post_sequence is
> > > visible, hence only wmb() (after spin_lock and pre_sequence++) is
> > > needed there and only rmb() is needed in the read-side.
>
> Hmm. Perhaps I was confused about how these things are intended
> to be used. If indeed the writer doesn't care about the order
> in which pre/post_sequence are accessed, then wmb is sufficient
> to keep their updates ordered.

yep, IMHO it should be enough.

btw, I'm speaking only about the fr_write_lock/unlock, not sure what the
write_begin/end are meant for, there are no fr_write_begin/end in the
patch I was reading (in 2.4). If fr_write_begin/end have to be retained
because they can do something useful, and they don't take the spinlock,
it could be needed there to use mb(), I just have no idea of where
write_begin/end could be useful so it's hard to say.

Andrea