From: Eric Dumazet <eric.dumazet@gmail.com>
To: Kevin Groeneveld <kgroeneveld@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] ppp: add 64 bit stats
Date: Wed, 25 Jul 2012 16:50:09 +0200 [thread overview]
Message-ID: <1343227809.2626.11159.camel@edumazet-glaptop> (raw)
In-Reply-To: <CABF+-6VAWVM=Cpyjk4iTbG-bBfHUs_CfRhe7rXmxxiF_ZX7_OA@mail.gmail.com>
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@gmail.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.
prev parent reply other threads:[~2012-07-25 14:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-22 20:19 [PATCH] ppp: add 64 bit stats Kevin Groeneveld
2012-07-22 21:54 ` David Miller
2012-07-23 0:32 ` Kevin Groeneveld
2012-07-23 0:40 ` David Miller
2012-07-23 5:16 ` Eric Dumazet
2012-07-23 15:25 ` Kevin Groeneveld
2012-07-23 15:59 ` Eric Dumazet
2012-07-24 1:53 ` Kevin Groeneveld
2012-07-24 6:22 ` Eric Dumazet
2012-07-25 2:27 ` Kevin Groeneveld
2012-07-25 4:04 ` Eric Dumazet
2012-07-25 14:43 ` Kevin Groeneveld
2012-07-25 14:50 ` Eric Dumazet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343227809.2626.11159.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=kgroeneveld@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox