From: Stephen Hemminger <shemminger@vyatta.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>, Arnd Bergmann <arnd@arndb.de>,
netdev@vger.kernel.org, linux-net-drivers@solarflare.com
Subject: Re: [PATCH 1/2] net: Enable 64-bit net device statistics on 32-bit architectures
Date: Fri, 4 Jun 2010 13:39:30 -0700 [thread overview]
Message-ID: <20100604133930.34e2d53b@nehalam> (raw)
In-Reply-To: <1275675318.2095.30.camel@achroite.uk.solarflarecom.com>
On Fri, 04 Jun 2010 19:15:18 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Fri, 2010-06-04 at 10:28 -0700, Stephen Hemminger wrote:
> > On Thu, 03 Jun 2010 20:11:38 +0100
> > Ben Hutchings <bhutchings@solarflare.com> wrote:
> >
> > > static inline u64 rtnl_link_stats64_read(const u64 *field)
> > > {
> > > return ACCESS_ONCE(*field);
> > > }
> > > static inline u32 rtnl_link_stats64_read32(const u64 *field)
> > > {
> > > return ACCESS_ONCE(*field);
> > > }
> >
> > Do we really care if compiler reorders access. I think not.
> > There was no order guarantee in the past.
>
> Since these reads are potentially racing with writes, we want to ensure
> that they are atomic. Without the volatile-qualification, the compiler
> can legitimately split or repeat the reads, though I don't see any
> particular reason why this is a likely optimisation.
>
> Ben.
>
But this part of the code is only being run on on 64 bit machines.
Updates of basic types for the CPU are atomic, lots of other code
already assumes this.
Take off your tin hat, this is excessive paranoia.
--
next prev parent reply other threads:[~2010-06-04 20:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 14:19 [PATCH] r8169: Add counters tx_bytes and rx_bytes for ethtool Junchang Wang
2010-05-25 19:56 ` Francois Romieu
2010-05-26 1:01 ` Junchang Wang
2010-05-25 23:15 ` David Miller
2010-05-26 0:51 ` Junchang Wang
2010-06-02 21:34 ` 64-bit net_device_stats Ben Hutchings
2010-06-02 21:59 ` Stephen Hemminger
2010-06-02 23:38 ` Arnd Bergmann
2010-06-03 14:51 ` Ben Hutchings
2010-06-03 17:39 ` [PATCH 1/2] net: Enable 64-bit net device statistics on 32-bit architectures Ben Hutchings
2010-06-03 18:47 ` Stephen Hemminger
2010-06-03 19:11 ` Ben Hutchings
2010-06-04 17:28 ` Stephen Hemminger
2010-06-04 18:15 ` Ben Hutchings
2010-06-04 20:39 ` Stephen Hemminger [this message]
2010-06-04 20:47 ` Ben Hutchings
2010-06-03 17:40 ` [PATCH 2/2] sfc: Implement 64-bit net device statistics on all architectures Ben Hutchings
2010-06-04 1:59 ` 64-bit net_device_stats Junchang Wang
2010-06-04 3:59 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100604133930.34e2d53b@nehalam \
--to=shemminger@vyatta.com \
--cc=arnd@arndb.de \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).