[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1343020585.2626.10054.camel@edumazet-glaptop>
Date: Mon, 23 Jul 2012 07:16:25 +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 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@...il.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)
--
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