[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1276603972.2541.99.camel@edumazet-laptop>
Date: Tue, 15 Jun 2010 14:12:52 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Nick Piggin <npiggin@...e.de>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
bhutchings@...arflare.com
Subject: Re: [PATCH net-next-2.6] net: Introduce u64_stats_sync
infrastructure
Le mardi 15 juin 2010 à 21:04 +1000, Nick Piggin a écrit :
> So if you have a regular seqlock, the sequence:
>
> write_seqcount_begin
> stat1++
> stat2--
> write_seqcount_end
>
> do read_seqcount_begin
> sum = stat1+stat2;
> while (read_seqcount_retry)
> BUG_ON(sum != 0);
>
> This code is OK. But if it is using your stat sync, then it is buggy.
> This is obvious to you of course, but someone who doesn't consider
> the implementation might get caught out.
>
> I guess all my other points are properties of seqcount code itself,
> but they are not documented really well with the seqlock API
> unfortunately.
>
Yep, not counting fact that stat_sync is a noop on 64 bits anyway, so
external synchronization is pretty much needed (and probably already
present on all path were I need this stuff. If not, it must be fixed)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists