[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120628082457.GA2507@raven>
Date: Thu, 28 Jun 2012 09:24:58 +0100
From: Tom Parkin <tparkin@...alix.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Rick Jones <rick.jones2@...com>,
Ben Greear <greearb@...delatech.com>,
Stephen Hemminger <shemminger@...tta.com>,
netdev@...r.kernel.org, David.Laight@...LAB.COM,
James Chapman <jchapman@...alix.com>
Subject: Re: [PATCH v2] l2tp: use per-cpu variables for u64_stats updates
On Thu, Jun 28, 2012 at 07:00:54AM +0200, Eric Dumazet 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
>
> 3) is overkill for devices with light traffic, because it consumes lot
> of RAM on machines with 2048 possible cpus, _and_ the reader must fold
> the data of all possible values.
Thanks Eric.
So am I right in thinking that a v3 patch which uses atomic_long_t for
the statistics would be the correct way forwards?
--
Tom Parkin
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)
Powered by blists - more mailing lists