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: Mon, 23 Jul 2012 07:16:25 +0200 [thread overview]
Message-ID: <1343020585.2626.10054.camel@edumazet-glaptop> (raw)
In-Reply-To: <1342988397-3077-1-git-send-email-kgroeneveld@gmail.com>
On Sun, 2012-07-22 at 16:19 -0400, Kevin Groeneveld wrote:
> Add 64 bit stats to ppp driver. The 64 bit stats include tx_bytes,
> rx_bytes, tx_packets and rx_packets. Other stats are still 32 bit.
> The 64 bit stats can be retrieved via the ndo_get_stats operation. The
> SIOCGPPPSTATS ioctl is still 32 bit stats only.
>
> Signed-off-by: Kevin Groeneveld <kgroeneveld@gmail.com>
> ---
> drivers/net/ppp/ppp_generic.c | 110 +++++++++++++++++++++++++++++++++++------
> 1 file changed, 95 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
> index 5c05572..210238c 100644
> --- a/drivers/net/ppp/ppp_generic.c
> +++ b/drivers/net/ppp/ppp_generic.c
> @@ -94,6 +94,19 @@ struct ppp_file {
> #define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel)
>
> /*
> + * Data structure to hold primary network stats for which
> + * we want to use 64 bit storage. Other network stats
> + * are stored in dev->stats of the ppp strucute.
> + */
> +struct ppp_link_stats {
> + struct u64_stats_sync syncp;
> + u64 tx_bytes;
> + u64 tx_packets;
> + u64 rx_bytes;
> + u64 rx_packets;
> +};
Hmm. This patches adds races, but also adds a good amount of memory on
these servers with thousand of ppp devices, and 64 cpus.
I really doubt ppp is performance sensitive, it so doesnt need percpu
counter.
If you really want 64bits stats on ppp, use proper synchronization
around u64 counters (but shared ones)
next prev parent reply other threads:[~2012-07-23 5:16 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 [this message]
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
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=1343020585.2626.10054.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