From: John Fastabend <john.r.fastabend@intel.com>
To: John Fastabend <john.fastabend@gmail.com>,
xiyou.wangcong@gmail.com, jhs@mojatatu.com,
eric.dumazet@gmail.com, davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: Re: [net-next PATCH 1/4] net: sched: make bstats per cpu and estimator RCU safe
Date: Fri, 26 Sep 2014 11:21:47 -0700 [thread overview]
Message-ID: <5425AEBB.4030509@intel.com> (raw)
In-Reply-To: <20140926181346.28430.19380.stgit@nitbit.x32>
On 09/26/2014 11:13 AM, John Fastabend wrote:
> From: John Fastabend <john.fastabend@gmail.com>
>
> In order to run qdisc's without locking statistics and estimators
> need to be handled correctly.
>
> To resolve bstats make the statistics per cpu. And because this is
> only needed for qdiscs that are running without locks which is not
> the case for most qdiscs in the near future only create percpu
> stats when qdiscs set the TCQ_F_CPUSTATS flag.
>
> Next because estimators use the bstats to calculate packets per
> second and bytes per second the estimator code paths are updated
> to use the per cpu statistics.
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
[...]
> return 0;
> diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c
> index 37e7d25..2f0ecd7 100644
> --- a/net/sched/sch_mqprio.c
> +++ b/net/sched/sch_mqprio.c
> @@ -234,8 +234,8 @@ static int mqprio_dump(struct Qdisc *sch, struct sk_buff *skb)
> qdisc = rtnl_dereference(netdev_get_tx_queue(dev, i)->qdisc);
> spin_lock_bh(qdisc_lock(qdisc));
> sch->q.qlen += qdisc->q.qlen;
> - sch->bstats.bytes += qdisc->bstats.bytes;
> - sch->bstats.packets += qdisc->bstats.packets;
> + sch->bstats->bytes += qdisc->bstats.bytes;
> + sch->bstats->packets += qdisc->bstats.packets;
> sch->qstats.qlen += qdisc->qstats.qlen;
> sch->qstats.backlog += qdisc->qstats.backlog;
OK v2 coming this patch got messed up and then fixed in the third
patch.
If you look at the bstats definition you'll see this obviously
wont compile. The end result is good but it wont bisect.
.John
prev parent reply other threads:[~2014-09-26 18:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 18:13 [net-next PATCH 1/4] net: sched: make bstats per cpu and estimator RCU safe John Fastabend
2014-09-26 18:14 ` [net-next PATCH 2/4] net: sched: implement qstat helper routines John Fastabend
2014-09-26 18:36 ` Eric Dumazet
2014-09-26 18:41 ` John Fastabend
2014-09-26 18:15 ` [net-next PATCH 3/4] net: sched: restrict use of qstats qlen John Fastabend
2014-09-26 18:15 ` [net-next PATCH 4/4] net: sched: enable per cpu qstats John Fastabend
2014-09-26 18:21 ` John Fastabend [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=5425AEBB.4030509@intel.com \
--to=john.r.fastabend@intel.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jhs@mojatatu.com \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).