[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1340907451.2577.3.camel@bwh-desktop.uk.solarflarecom.com>
Date: Thu, 28 Jun 2012 19:17:31 +0100
From: Ben Hutchings <bhutchings@...arflare.com>
To: David Laight <David.Laight@...LAB.COM>
CC: Eric Dumazet <eric.dumazet@...il.com>,
Rick Jones <rick.jones2@...com>,
Ben Greear <greearb@...delatech.com>,
Stephen Hemminger <shemminger@...tta.com>,
Tom Parkin <tparkin@...alix.com>, <netdev@...r.kernel.org>,
James Chapman <jchapman@...alix.com>
Subject: RE: [PATCH v2] l2tp: use per-cpu variables for u64_stats updates
On Thu, 2012-06-28 at 09:46 +0100, David Laight wrote:
> > [1] : LLTX drivers case
> > since ndo_start_xmit() can be run concurrently by many cpus, safely
> > updating an "unsigned long" requires additional hassle :
> >
> > 1) Use of a spinlock to protect the update.
> > 2) Use atomic_long_t instead of "unsigned long"
> > 3) Use percpu data
>
> 4) These are statistics so it shouldn't really matter if
> they are out by a small number.
You might be surprised just how much end users care about statistics.
> So the errors
> introduced by unlocked updates can probably be ignored.
> So just use 'unsigned long'.
This can result in statistics being decremented in case of a race. That
should never be allowed to happen.
Ben.
> Might be worth putting in gcc barriers so that the
> load and store instructions aren't separated too far.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
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