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: <CAJ3xEMhuhAjn5TdoOxSLXmsGbEbhP1QJ4up63NiUgN_JEU8Jmw@mail.gmail.com>
Date:   Wed, 8 Nov 2017 23:20:52 +0900
From:   Or Gerlitz <gerlitz.or@...il.com>
To:     Manish Kurup <kurup.manish@...il.com>
Cc:     Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        David Miller <davem@...emloft.net>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Pieter Jansen van Vuuren 
        <pieter.jansenvanvuuren@...ronome.com>,
        Simon Horman <simon.horman@...ronome.com>,
        John Hurley <john.hurley@...ronome.com>,
        oss-drivers@...ronome.com,
        Linux Netdev List <netdev@...r.kernel.org>,
        aring@...atatu.com, Roman Mashak <mrv@...atatu.com>,
        Manish Kurup <manish.kurup@...izon.com>
Subject: Re: [PATCH net-next v10 1/3] act_vlan: Change stats update to use
 per-core stats

On Wed, Nov 8, 2017 at 9:03 PM, Manish Kurup <kurup.manish@...il.com> wrote:
> The VLAN action maintains one set of stats across all cores, and uses a
> spinlock to synchronize updates to it from the same. Changed this to use a
> per-CPU stats context instead.
> This change will result in better performance.
>
> Acked-by: Jamal Hadi Salim <jhs@...atatu.com>
> Acked-by: Jiri Pirko <jiri@...lanox.com>
> Signed-off-by: Manish Kurup <manish.kurup@...izon.com>
> ---
>  net/sched/act_vlan.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c
> index 115fc33..8a35efe 100644
> --- a/net/sched/act_vlan.c
> +++ b/net/sched/act_vlan.c
> @@ -30,9 +30,10 @@ static int tcf_vlan(struct sk_buff *skb, const struct tc_action *a,
>         int err;
>         u16 tci;
>
> -       spin_lock(&v->tcf_lock);
>         tcf_lastuse_update(&v->tcf_tm);
> -       bstats_update(&v->tcf_bstats, skb);
> +       bstats_cpu_update(this_cpu_ptr(v->common.cpu_bstats), skb);
> +
> +       spin_lock(&v->tcf_lock);
>         action = v->tcf_action;

(if this was asked && answered in earlier Vs, sorry for that, if not and I got
some small real problem here && you're @ netdev, maybe buy me Korean beer?)

before your changes the spin lock also protected the lastuse update call but
now it doesn't, why?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ