[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1343227809.2626.11159.camel@edumazet-glaptop>
Date: Wed, 25 Jul 2012 16:50:09 +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 Wed, 2012-07-25 at 10:43 -0400, Kevin Groeneveld wrote:
> On Wed, Jul 25, 2012 at 12:04 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> > It there are spinlocks already, why even adding u64_stats_sync ?
>
> That is a good question I have already wondered about myself.
>
> >include/linux/u64_stats_sync.h
> >
> >* 3) Write side must ensure mutual exclusion or one seqcount update could
> > * be lost, thus blocking readers forever.
> > * If this synchronization point is not a mutex, but a spinlock or
> > * spinlock_bh() or disable_bh() :
>
> It seems the u64_stats_sync requires some form of mutual exclusion.
> So why bother ever using it at all? Maybe there are cases where the
> required mutual exclusion can be cheaper than a spinlock? Maybe it is
> just to avoid the spinlocks on the read side of things?
>
> I hope you don't mind all my questions...
u64_stats_sync is good for write sides without any locking,
for example using percpu data.
So if you use shared counters, u64_stats_sync has no value.
--
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