public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	John Fastabend <john.r.fastabend@intel.com>
Subject: Re: [PATCH net-next] net: minor optimization in qdisc_qstats_cpu_drop()
Date: Wed, 24 Aug 2016 11:00:28 -0700	[thread overview]
Message-ID: <57BDE0BC.9040607@gmail.com> (raw)
In-Reply-To: <1472059414.14381.101.camel@edumazet-glaptop3.roam.corp.google.com>

On 16-08-24 10:23 AM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> per_cpu_inc() is faster (at least on x86) than per_cpu_ptr(xxx)++;
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
>  include/net/sch_generic.h |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
> index 0d501779cc68f9426e58da6d039dd64adc937c20..52a2015667b49c8315edbb26513a98d4c677fee5 100644
> --- a/include/net/sch_generic.h
> +++ b/include/net/sch_generic.h
> @@ -592,7 +592,7 @@ static inline void qdisc_qstats_drop(struct Qdisc *sch)
>  
>  static inline void qdisc_qstats_cpu_drop(struct Qdisc *sch)
>  {
> -	qstats_drop_inc(this_cpu_ptr(sch->cpu_qstats));
> +	this_cpu_inc(sch->cpu_qstats->drops);
>  }
>  
>  static inline void qdisc_qstats_overlimit(struct Qdisc *sch)
> 
> 

Looks good to me. I guess we can also do the same for overlimit qstats.

Acked-by: John Fastabend <john.r.fastabend@intel.com>

  reply	other threads:[~2016-08-24 18:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 17:23 [PATCH net-next] net: minor optimization in qdisc_qstats_cpu_drop() Eric Dumazet
2016-08-24 18:00 ` John Fastabend [this message]
2016-08-24 19:13   ` Eric Dumazet
2016-08-24 18:04 ` Rick Jones
2016-08-24 19:07   ` Eric Dumazet
2016-08-25 23:45 ` David Miller

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=57BDE0BC.9040607@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=john.r.fastabend@intel.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