[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1321540078.2751.38.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
Date: Thu, 17 Nov 2011 15:27:58 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: Junchang Wang <junchangwang@...il.com>,
Stephen Hemminger <stephen.hemminger@...tta.com>,
netdev@...r.kernel.org, romieu@...zoreil.com,
nic swsd <nic_swsd@...ltek.com>
Subject: RE: [PATCH net-next] r8169: Add 64bit statistics
Le jeudi 17 novembre 2011 à 14:01 +0000, David Laight a écrit :
> Ah yes ...
>
> Both u64_stats_update_begin & _end increment a numeric field
> with an appropriate memory barrier. So the 'update' path
> has two extra read-modify-write sequences (possibly the
> 2nd read can be optimised out), and two smp_wmb() that may
> introduce bus delays.
>
> Would be fine if it were guaranteed to work!
> Consider the following sequence of events:
> u64_stats_update_begin()
> calculate 'count+1'
> read_seqcount_begin()
> read count_hi
> write count_lo
> read count_lo
> write count_hi
> read_seqcount_retry()
> ... update other counters ...
> u64_stats_update_end()
> The reader gets an invalid value since it reads the same
> 'sequence' both times.
>
> Could be fixed by using '|= 1' in update_begin and
> looping on odd values in read_seqcount_begin().
>
I am a bit tired of this discussion.
You obviously dont understand how the thing is working.
Spend some time on it before claiming there are bugs.
--
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