All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jason Baron <jbaron@akamai.com>,
	"Steven Rostedt (VMware)" <rostedt@goodmis.org>
Subject: Re: [PATCH 2/2] jump_label: refine placement of static_keys
Date: Wed, 10 Nov 2021 11:24:12 +0100	[thread overview]
Message-ID: <CAMj1kXF8makQnZaWDpyzQc2ZiwQEU1ACYhrA91UaFT6S-6RXaQ@mail.gmail.com> (raw)
In-Reply-To: <YYuEXQ7Ur9f88pCw@hirez.programming.kicks-ass.net>

On Wed, 10 Nov 2021 at 09:36, Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Tue, Nov 09, 2021 at 05:09:06PM -0800, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.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@google.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.
>
> 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 :/

No, that doesn't work. Section placement is an attribute of the symbol
not of its type. So we'll need to macro'ify this.

But I'm not sure I understand why we need different policies here.
Static keys are inherently __read_mostly (unless they are not writable
to begin with), so keeping them all together in one place in the
binary should be sufficient, no?

  reply	other threads:[~2021-11-10 10:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  1:09 [PATCH 0/2] jump_label: add __static_key macro Eric Dumazet
2021-11-10  1:09 ` [PATCH 1/2] jump_label: use DEFINE_STATIC_KEY_FALSE_RO() where possible Eric Dumazet
2021-11-10  1:09 ` [PATCH 2/2] jump_label: refine placement of static_keys Eric Dumazet
2021-11-10  8:35   ` Peter Zijlstra
2021-11-10 10:24     ` Ard Biesheuvel [this message]
2021-11-10 15:22       ` Eric Dumazet
2021-11-10 17:06         ` Ard Biesheuvel
2021-11-10 17:43           ` Eric Dumazet
2021-11-10 15:30     ` Eric Dumazet
2021-11-10 15:41       ` Eric Dumazet
2021-11-14 14:07   ` [jump_label] b8efb810ab: leaking-addresses.proc..data.unlikely kernel test robot
2021-11-14 14:07     ` kernel test robot

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=CAMj1kXF8makQnZaWDpyzQc2ZiwQEU1ACYhrA91UaFT6S-6RXaQ@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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 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.