[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1472648936.14381.313.camel@edumazet-glaptop3.roam.corp.google.com>
Date: Wed, 31 Aug 2016 06:08:56 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Tom Herbert <tom@...bertland.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org, rick.jones2@....com,
kernel-team@...com
Subject: Re: [PATCH RFC 2/4] bql: Add tracking of inflight packets
On Tue, 2016-08-30 at 17:00 -0700, Tom Herbert wrote:
> Add two fields to netdev_queue as head_cnt and tail_cnt. head_cnt is
> incremented for every sent packet in netdev_tx_sent_queue and tail_cnt
> is incremented by the number of packets in netdev_tx_completed_queue.
> So then the number of inflight packets for a queue is simply
> queue->head_cnt - queue->tail_cnt.
>
> Add inflight_pkts to be reported in sys-fs.
>
> Signed-off-by: Tom Herbert <tom@...bertland.com>
> ---
> include/linux/netdevice.h | 4 ++++
> net/core/net-sysfs.c | 11 +++++++++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index d122be9..487d1df 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -592,6 +592,8 @@ struct netdev_queue {
>
> #ifdef CONFIG_BQL
> struct dql dql;
> + unsigned int head_cnt;
> + unsigned int tail_cnt;
> #endif
> } ____cacheline_aligned_in_smp;
>
You probably should put these fields in the appropriate cache lines of
"struct dql" : It will provide better cache behavior and fill holes.
Powered by blists - more mailing lists