[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1343110954.2626.11040.camel@edumazet-glaptop>
Date: Tue, 24 Jul 2012 08:22:34 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: Kevin Groeneveld <kgroeneveld@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] ppp: add 64 bit stats
On Mon, 2012-07-23 at 21:53 -0400, Kevin Groeneveld wrote:
> On Mon, Jul 23, 2012 at 11:59 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> >> Would proper synchronization in this case just be wrapping the updates
> >> in a spin_lock/spin_unlock?
> >
> > Would be fine (if the proper BH safe variant is used), or you could also
> > use atomic64_t.
>
> Which would you recommend, spin locks or atomic64_t?
>
> atomic64_t seems like it would be simpler.
Simpler but a bit more expensive when two counters are changed at the
same time.
(two atomic ops instead of a single one for the spinlock)
--
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