All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [RFC PATCH 14/15] net: sched: make qstats per cpu
Date: Wed, 30 Apr 2014 15:29:14 -0700	[thread overview]
Message-ID: <5361793A.7000201@gmail.com> (raw)
In-Reply-To: <CAM_iQpUMJcP3guRvCPBGqfzTbVn+t4uZ8eETGVnwk5Y88ZJi_A@mail.gmail.com>

On 04/30/2014 10:08 AM, Cong Wang wrote:
> On Wed, Apr 30, 2014 at 9:40 AM, John Fastabend
> <john.fastabend@gmail.com> wrote:
>> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
>> index 1a55e19..6d67a27 100644
>> --- a/include/net/sch_generic.h
>> +++ b/include/net/sch_generic.h
>> @@ -92,7 +92,10 @@ struct Qdisc {
>>                  struct gnet_stats_basic_cpu __percpu *cpu_bstats;
>>          } bstats_qdisc;
>>          unsigned int            __state;
>> -       struct gnet_stats_queue qstats;
>> +       union {
>> +               struct gnet_stats_queue qstats;
>> +               struct gnet_stats_queue __percpu *cpu_qstats;
>> +       } qstats_qdisc;
>>          struct rcu_head         rcu_head;
>>          int                     padded;
>>          atomic_t                refcnt;
>
>
> So only ingress qdisc uses ->cpu_qstats, the rest still uses
> ->qstats. Hmm, doesn't this mean ingress qdisc should init
> ->cpu_qstats in its ->init()?
>
> [...]
>
>> diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
>> index 5700c27..2423d7b 100644
>> --- a/net/sched/sch_ingress.c
>> +++ b/net/sched/sch_ingress.c
>> @@ -58,6 +58,7 @@ static struct tcf_proto **ingress_find_tcf(struct Qdisc *sch, unsigned long cl)
>>   static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
>>   {
>>          struct ingress_qdisc_data *p = qdisc_priv(sch);
>> +       struct gnet_stats_queue *qstats;
>>          struct tcf_result res;
>>          struct tcf_proto *fl = rcu_dereference_bh(p->filter_list);
>>          int result;
>> @@ -68,7 +69,8 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
>>          switch (result) {
>>          case TC_ACT_SHOT:
>>                  result = TC_ACT_SHOT;
>> -               sch->qstats.drops++;
>> +               qstats = this_cpu_ptr(sch->qstats_qdisc.cpu_qstats);
>> +               qstats->drops++;
>>                  break;
>>          case TC_ACT_STOLEN:
>>          case TC_ACT_QUEUED:
>
> I don't see you call alloc_percpu() and free_percpu() in sch_ingress.c.
>


Right I missed this update in the patch set its included now. Although
its part of sch_api.c and triggers off the TCQ_F_LLQDISC flag.

Thanks,
John

-- 
John Fastabend         Intel Corporation

  reply	other threads:[~2014-04-30 22:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 16:34 [RFC PATCH 00/15] remove qdisc lock from ingress_qdisc John Fastabend
2014-04-30 16:35 ` [RFC PATCH 01/15] net: qdisc: use rcu prefix and silence sparse warnings John Fastabend
2014-04-30 17:00   ` Eric Dumazet
2014-04-30 22:25     ` John Fastabend
2014-04-30 23:29       ` Eric Dumazet
2014-05-01 15:20         ` John Fastabend
2014-05-14 19:39   ` John Fastabend
2014-05-15 20:41     ` Paul E. McKenney
2014-05-15 21:11       ` John Fastabend
2014-05-15 20:43     ` David Miller
2014-04-30 16:35 ` [RFC PATCH 02/15] net: rcu-ify tcf_proto John Fastabend
2014-04-30 16:36 ` [RFC PATCH 03/15] net: sched: cls_basic use RCU John Fastabend
2014-04-30 16:36 ` [RFC PATCH 04/15] net: sched: cls_cgroup " John Fastabend
2014-04-30 16:36 ` [RFC PATCH 05/15] net: sched: cls_flow " John Fastabend
2014-04-30 16:37 ` [RFC PATCH 06/15] net: sched: fw " John Fastabend
2014-04-30 16:37 ` [RFC PATCH 07/15] net: sched: RCU cls_route John Fastabend
2014-04-30 16:38 ` [RFC PATCH 08/15] net: sched: RCU cls_tcindex John Fastabend
2014-04-30 16:38 ` [RFC PATCH 09/15] net: sched: make cls_u32 lockless John Fastabend
2014-04-30 16:39 ` [RFC PATCH 10/15] net: sched: rcu'ify cls_rsvp John Fastabend
2014-04-30 16:39 ` [RFC PATCH 11/15] net: make cls_bpf rcu safe John Fastabend
2014-04-30 16:39 ` [RFC PATCH 12/15] net: sched: make tc_action safe to walk under RCU John Fastabend
2014-04-30 16:40 ` [RFC PATCH 13/15] net: sched: make bstats per cpu and estimator RCU safe John Fastabend
2014-04-30 16:40 ` [RFC PATCH 14/15] net: sched: make qstats per cpu John Fastabend
2014-04-30 17:08   ` Cong Wang
2014-04-30 22:29     ` John Fastabend [this message]
2014-04-30 16:41 ` [RFC PATCH 15/15] net: sched: drop ingress qdisc lock John Fastabend

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=5361793A.7000201@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.