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: <CANn89iLSvNzgDc4s5rv65eELx2fGVzb6Nj=8D7T3Up8Wgsm_SA@mail.gmail.com>
Date:   Wed, 10 Nov 2021 07:30:22 -0800
From:   Eric Dumazet <edumazet@...gle.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Eric Dumazet <eric.dumazet@...il.com>,
        linux-kernel <linux-kernel@...r.kernel.org>, jpoimboe@...hat.com,
        jbaron@...mai.com, rostedt@...dmis.org, ardb@...nel.org
Subject: Re: [PATCH 2/2] jump_label: refine placement of static_keys

On Wed, Nov 10, 2021 at 12:35 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Tue, Nov 09, 2021 at 05:09:06PM -0800, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@...gle.com>
> >
> > With CONFIG_JUMP_LABEL=y, "struct static_key" content is only
> > used for the control path.
> >
> > Marking them __read_mostly is only needed when CONFIG_JUMP_LABEL=n.
> > Otherwise we place them out of the way to increase data locality.
> >
> > This patch adds __static_key to centralize this new policy.
> >
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > ---
> >  arch/x86/kvm/lapic.c       |  4 ++--
> >  arch/x86/kvm/x86.c         |  2 +-
> >  include/linux/jump_label.h | 25 +++++++++++++++++--------
> >  kernel/events/core.c       |  2 +-
> >  kernel/sched/fair.c        |  2 +-
> >  net/core/dev.c             |  8 ++++----
> >  net/netfilter/core.c       |  2 +-
> >  net/netfilter/x_tables.c   |  2 +-
> >  8 files changed, 28 insertions(+), 19 deletions(-)
> >
>
> Hurmph, it's a bit cumbersome to always have to add this __static_key
> attribute to every definition, and in fact you seem to have missed some.

Sure, I can make sure to include all cases. I was hoping
DEFINE_STATIC_KEY_TRUE()/DEFINE_STATIC_KEY_FALSE()
would catch the majority of uses.

We also can add a new DEFINE_STATIC_KEY() macro to ease these cases.



>
> Would something like:
>
>         typedef struct static_key __static_key static_key_t;
>
> work? I forever seem to forget the exact things you can make a typedef
> do :/

I tried, but a typedef was not working. A macro would work.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ