Re: [patches] seqlock: add barrier-less special cases for seqcounts

From: Linus Torvalds
Date: Fri Nov 12 2010 - 18:53:30 EST


On Fri, Nov 12, 2010 at 3:06 PM, Nick Piggin <npiggin@xxxxxxxxx> wrote:
. ...
> seq2 = read_seqlock_begin(&child->d_seq);
> if (read_seqcount_retry(&dentry->d_seq, seq))
> /* bail out */

So the only issue is that this particular back-to-back sequence with
these kinds of "take one seqlock and release the previous one" where
you currently end up having basically one smp_rmb() at the end of
"read_seqlock_begin()", only to be followed immediately by another one
starting out the "read_seqcount_retry()"?

If so, I think we should make _that_ operation ("move from one seqlock
to another") be the special one, because it smells like in general,
using the special non-locking versions is going to be a very subtle
interface.

Linus
--
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/