lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57BDE0BC.9040607@gmail.com>
Date:   Wed, 24 Aug 2016 11:00:28 -0700
From:   John Fastabend <john.fastabend@...il.com>
To:     Eric Dumazet <eric.dumazet@...il.com>,
        David Miller <davem@...emloft.net>
Cc:     netdev <netdev@...r.kernel.org>,
        John Fastabend <john.r.fastabend@...el.com>
Subject: Re: [PATCH net-next] net: minor optimization in
 qdisc_qstats_cpu_drop()

On 16-08-24 10:23 AM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@...gle.com>
> 
> per_cpu_inc() is faster (at least on x86) than per_cpu_ptr(xxx)++;
> 
> Signed-off-by: Eric Dumazet <edumazet@...gle.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@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ