mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: linux-kernel@vger.kernel.org, frederic@kernel.org,
	jstultz@google.com, juri.lelli@redhat.com, meted@linux.ibm.com,
	mingo@redhat.com, peterz@infradead.org, sshegde@linux.ibm.com,
	tglx@linutronix.de, vincent.guittot@linaro.org,
	vschneid@redhat.com
Subject: Re: [PATCH v2 5/6] sched: dynamic: Remove HAVE_PREEMPT_DYNAMIC_{CALL,KEY}
Date: Tue, 1 Sep 2026 16:26:46 +0100	[thread overview]
Message-ID: <apbutocBHjiBTmCd@J2N7QTR9R3.cambridge.arm.com> (raw)
In-Reply-To: <65b9ac80-1503-41ad-adee-59f9260fe4e0@huawei.com>

On Fri, Aug 07, 2026 at 09:54:13AM +0800, Jinjie Ruan wrote:
> 
> 
> 在 2026/8/4 3:17, Mark Rutland 写道:
> > PREEMPT_DYNAMIC is now limited to the FULL and LAZY preemption models.
> > Switching model only changes the behaviour of dynamic_preempt_lazy(),
> > which uses a static key. There are no other static calls or static keys,
> > and so there's no need for HAVE_PREEMPT_DYNAMIC_CALL or
> > HAVE_PREEMPT_DYNAMIC_KEY.
> > 
> > The static key used by dynamic_preempt_lazy() is entirely local to
> > kernel/sched/core.c, and any architecture which selects
> > ARCH_HAS_PREEMPT_LAZY implements the necessary support. Remove
> > PREEMPT_DYNAMIC's dependencies on HAVE_PREEMPT_DYNAMIC_CALL and
> > HAVE_PREEMPT_DYNAMIC_KEY entirely, leaving the dependency on
> > ARCH_HAS_PREEMPT_LAZY.
> > 
> > For architectures which previously selected HAVE_PREEMPT_DYNAMIC_KEY,
> > PREEMPT_DYNAMIC will now be selected by default, matching x86. As the
> > runtime impact is limited to dynamic_preempt_lazy(), this shouldn't be
> > as concerning as previously (e.g. where calls to {cond,might}_resched()
> > stubs could introduce a measurable penalty).
> > 
> > As all of this can work without jump labels, JUMP_LABEL is not selected
> > explicitly. It is obviously preferable to have JUMP_LABEL enabled, but
> > this is not functionally necessary.

[...]

> > diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
> > index fb49424003b2b..87d567680bc74 100644
> > --- a/kernel/Kconfig.preempt
> > +++ b/kernel/Kconfig.preempt
> > @@ -128,11 +128,9 @@ config PREEMPTION
> >  
> >  config PREEMPT_DYNAMIC
> >  	bool "Preemption behaviour defined on boot"
> > -	depends on HAVE_PREEMPT_DYNAMIC
> >  	depends on ARCH_HAS_PREEMPT_LAZY
> > -	select JUMP_LABEL if HAVE_PREEMPT_DYNAMIC_KEY
> 
> After this, only the arm64 architecture explicitly selects JUMP_LABEL.
> When we remove the dependency on HAVE_PREEMPT_DYNAMIC_KEY, should we
> also select JUMP_LABEL for those architectures.
> 
> git grep "select JUMP_LABEL"
> arch/arm64/Kconfig:     select JUMP_LABEL
> block/Kconfig:  select JUMP_LABEL if HAVE_ARCH_JUMP_LABEL
> fs/xfs/Kconfig: select JUMP_LABEL if HAVE_ARCH_JUMP_LABEL
> fs/xfs/Kconfig: select JUMP_LABEL if HAVE_ARCH_JUMP_LABEL

I had deliberately avoided selecting JUMP_LABEL. As the commit message
says, it's not functionally necessary. It also wasn't previously
selected for !HAVE_PREEMPT_DYNAMIC_KEY (e.g. on x86). The relevant
defconfig files have CONFIG_JUMP_LABEL=y regardless, so it ends up being
on by default in practice.

Not selecting JUMP_LABEL allows it to be turned off for testing, so I
would prefer to leave it as-is.

> otherwise
> Reviewed-by: Jinjie Ruan <ruanjinjie@huawei.com>

Thanks!

Mark.

  reply	other threads:[~2026-09-01 15:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 19:17 [PATCH v2 0/6] sched: dynamic: Simplify PREEMPT_DYNAMIC Mark Rutland
2026-08-03 19:17 ` [PATCH v2 1/6] sched: dynamic: Make PREEMPT_DYNAMIC depend on ARCH_HAS_PREEMPT_LAZY Mark Rutland
2026-09-02  7:54   ` [tip: sched/core] " tip-bot2 for Mark Rutland
2026-08-03 19:17 ` [PATCH v2 2/6] sched: dynamic: Simplify {cond,might}_resched() Mark Rutland
2026-08-05 10:08   ` Jinjie Ruan
2026-09-02  7:54   ` [tip: sched/core] " tip-bot2 for Mark Rutland
2026-08-03 19:17 ` [PATCH v2 3/6] sched: dynamic: Simplify preempt_schedule{,_notrace}() Mark Rutland
2026-08-06 13:23   ` Jinjie Ruan
2026-09-02  7:54   ` [tip: sched/core] " tip-bot2 for Mark Rutland
2026-08-03 19:17 ` [PATCH v2 4/6] sched: dynamic: Simplify irqentry_exit_cond_resched() Mark Rutland
2026-08-07  1:35   ` Jinjie Ruan
2026-09-02  7:54   ` [tip: sched/core] " tip-bot2 for Mark Rutland
2026-08-03 19:17 ` [PATCH v2 5/6] sched: dynamic: Remove HAVE_PREEMPT_DYNAMIC_{CALL,KEY} Mark Rutland
2026-08-07  1:54   ` Jinjie Ruan
2026-09-01 15:26     ` Mark Rutland [this message]
2026-09-02  7:54   ` [tip: sched/core] " tip-bot2 for Mark Rutland
2026-08-03 19:17 ` [PATCH v2 6/6] sched: dynamic: Simplify preempt model accessors Mark Rutland
2026-08-07  2:00   ` Jinjie Ruan
2026-09-01 16:03     ` Mark Rutland
2026-09-02  7:54   ` [tip: sched/core] " tip-bot2 for Mark Rutland
2026-08-05  9:52 ` [PATCH v2 0/6] sched: dynamic: Simplify PREEMPT_DYNAMIC Mete Durlu
2026-08-06 12:15 ` Shrikanth Hegde
2026-08-07  3:11 ` Jinjie Ruan
2026-09-03  1:30   ` Jinjie Ruan
2026-08-07  3:33 ` Jinjie Ruan
2026-09-01 16:04   ` Mark Rutland

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=apbutocBHjiBTmCd@J2N7QTR9R3.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=frederic@kernel.org \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meted@linux.ibm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ruanjinjie@huawei.com \
    --cc=sshegde@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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

all inboxes | Powered by JetHome®