[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6026B6F6B@saturn3.aculab.com>
Date: Thu, 28 Jun 2012 09:46:47 +0100
From: "David Laight" <David.Laight@...LAB.COM>
To: "Eric Dumazet" <eric.dumazet@...il.com>,
"Rick Jones" <rick.jones2@...com>
Cc: "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
> [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. So the errors
introduced by unlocked updates can probably be ignored.
So just use 'unsigned long'.
Might be worth putting in gcc barriers so that the
load and store instructions aren't separated too far.
David
--
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