From nobody Fri Oct 2 07:46:14 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AAF1F30D3F8 for ; Mon, 3 Aug 2026 19:17:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784672; cv=none; b=fsBLX+gjnYh/Z/G2Sjiw8K7VU8FwDPAKor9HPmOxSG6Ad4aIK8FTuF0XcmvdRIRDnPhxOmaV7sIoeCD2PPMuprC0gdMKuBIca9Psww1mtR+sp0fBYDGFmB3XviLSmQEeYVf96Q0Kbr4pa52WKIhYzjcfJl85ZWUZTDVgdIxRWao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784672; c=relaxed/simple; bh=djgewtzgZwx2EX2+PyZdnKi+8yfXbEHX1vHU3JCaPIQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u+EpqVOflak35isHGwcI8YA0XQ6MOJwyfZXBkTI1O9T0fkAEcgeWTy50CgeBeXWBazOCs/TCOYRQGxMAV4dyp482TJH4W7ZPLOAEO8zNx21TQh26hpEWD9duVYKBZG7gt6y99pdYh4dfSqW5IcQG9If1kT8KpmuLJ3dIR1g2lBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=QxlHx1uT; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="QxlHx1uT" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C1A111476; Mon, 3 Aug 2026 12:17:44 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E1B783F632; Mon, 3 Aug 2026 12:17:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785784668; bh=djgewtzgZwx2EX2+PyZdnKi+8yfXbEHX1vHU3JCaPIQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QxlHx1uT6sHC75INXIF8Akij9e95DYDGcVUefxLqVHvC0Qudvb9a6wvxnCXJPG+BT 9rGStI8TLhC2pd7mFpOrAmFlYG/P280kG4ykzT8R76X4pqMJI8LP0jhZoI8iXPd89S hNWubHSZNY7/CxZOJ8IDLE9CzWd6ttUlEajHKGgQ= From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mark.rutland@arm.com, meted@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, ruanjinjie@huawei.com, sshegde@linux.ibm.com, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com Subject: [PATCH v2 1/6] sched: dynamic: Make PREEMPT_DYNAMIC depend on ARCH_HAS_PREEMPT_LAZY Date: Mon, 3 Aug 2026 20:17:26 +0100 Message-Id: <20260803191731.3244294-2-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com> References: <20260803191731.3244294-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On architectures which select ARCH_HAS_PREEMPT_LAZY, it has not been possible to select the NONE and VOLUNTARY preemption models since commit: 7dadeaa6e851 ("sched: Further restrict the preemption modes") ... which was merged in v7.0. All architectures which currently support PREEMPT_DYNAMIC select ARCH_HAS_PREEMPT_LAZY: [mark@lakrids:~/src/linux]% git describe HEAD v7.2-rc1-1-g871a4586ea2e1 [mark@lakrids:~/src/linux]% git grep 'select HAVE_PREEMPT_DYNAMIC_' -- ar= ch arch/arm64/Kconfig: select HAVE_PREEMPT_DYNAMIC_KEY arch/loongarch/Kconfig: select HAVE_PREEMPT_DYNAMIC_KEY arch/powerpc/Kconfig: select HAVE_PREEMPT_DYNAMIC_KEY arch/riscv/Kconfig: select HAVE_PREEMPT_DYNAMIC_KEY arch/s390/Kconfig: select HAVE_PREEMPT_DYNAMIC_KEY arch/x86/Kconfig: select HAVE_PREEMPT_DYNAMIC_CALL [mark@lakrids:~/src/linux]% git grep 'select ARCH_HAS_PREEMPT_LAZY' -- ar= ch arch/arm64/Kconfig: select ARCH_HAS_PREEMPT_LAZY arch/loongarch/Kconfig: select ARCH_HAS_PREEMPT_LAZY arch/powerpc/Kconfig: select ARCH_HAS_PREEMPT_LAZY arch/riscv/Kconfig: select ARCH_HAS_PREEMPT_LAZY arch/s390/Kconfig: select ARCH_HAS_PREEMPT_LAZY arch/x86/Kconfig: select ARCH_HAS_PREEMPT_LAZY ... and hence in practice PREEMPT_DYNAMIC no longer supports the NONE or VOLUNTARY preemption models. Make this official: have PREEMPT_DYNAMIC depend on ARCH_HAS_PREEMPT_LAZY, and remove the trivially unreachable code. Further simplifications will be made in subsequent patches. Signed-off-by: Mark Rutland Reviewed-by: Shrikanth Hegde Reviewed-by: Jinjie Ruan Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: John Stultz Cc: Juri Lelli Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Guittot Tested-by: Jinjie Ruan Tested-by: Mete Durlu Tested-by: Shrikanth Hegde --- kernel/Kconfig.preempt | 1 + kernel/sched/core.c | 63 ++---------------------------------------- 2 files changed, 4 insertions(+), 60 deletions(-) diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index 88c594c6d7fcd..fb49424003b2b 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -129,6 +129,7 @@ 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 select PREEMPT_BUILD default y if HAVE_PREEMPT_DYNAMIC_CALL diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 96226707c2f61..2db78826a484b 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7870,20 +7870,10 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); * * * NONE: - * cond_resched <- __cond_resched - * might_resched <- RET0 - * preempt_schedule <- NOP - * preempt_schedule_notrace <- NOP - * irqentry_exit_cond_resched <- NOP - * dynamic_preempt_lazy <- false + * (unselectable) * * VOLUNTARY: - * cond_resched <- __cond_resched - * might_resched <- __cond_resched - * preempt_schedule <- NOP - * preempt_schedule_notrace <- NOP - * irqentry_exit_cond_resched <- NOP - * dynamic_preempt_lazy <- false + * (unselectable) * * FULL: * cond_resched <- RET0 @@ -7914,21 +7904,11 @@ int preempt_dynamic_mode =3D preempt_dynamic_undefi= ned; =20 int sched_dynamic_mode(const char *str) { -# if !(defined(CONFIG_PREEMPT_RT) || defined(CONFIG_ARCH_HAS_PREEMPT_LAZY)) - if (!strcmp(str, "none")) - return preempt_dynamic_none; - - if (!strcmp(str, "voluntary")) - return preempt_dynamic_voluntary; -# endif - if (!strcmp(str, "full")) return preempt_dynamic_full; =20 -# ifdef CONFIG_ARCH_HAS_PREEMPT_LAZY if (!strcmp(str, "lazy")) return preempt_dynamic_lazy; -# endif =20 return -EINVAL; } @@ -7950,40 +7930,7 @@ static DEFINE_MUTEX(sched_dynamic_mutex); =20 static void __sched_dynamic_update(int mode) { - /* - * Avoid {NONE,VOLUNTARY} -> FULL transitions from ever ending up in - * the ZERO state, which is invalid. - */ - preempt_dynamic_enable(cond_resched); - preempt_dynamic_enable(might_resched); - preempt_dynamic_enable(preempt_schedule); - preempt_dynamic_enable(preempt_schedule_notrace); - preempt_dynamic_enable(irqentry_exit_cond_resched); - preempt_dynamic_key_disable(preempt_lazy); - switch (mode) { - case preempt_dynamic_none: - preempt_dynamic_enable(cond_resched); - preempt_dynamic_disable(might_resched); - preempt_dynamic_disable(preempt_schedule); - preempt_dynamic_disable(preempt_schedule_notrace); - preempt_dynamic_disable(irqentry_exit_cond_resched); - preempt_dynamic_key_disable(preempt_lazy); - if (mode !=3D preempt_dynamic_mode) - pr_info("Dynamic Preempt: none\n"); - break; - - case preempt_dynamic_voluntary: - preempt_dynamic_enable(cond_resched); - preempt_dynamic_enable(might_resched); - preempt_dynamic_disable(preempt_schedule); - preempt_dynamic_disable(preempt_schedule_notrace); - preempt_dynamic_disable(irqentry_exit_cond_resched); - preempt_dynamic_key_disable(preempt_lazy); - if (mode !=3D preempt_dynamic_mode) - pr_info("Dynamic Preempt: voluntary\n"); - break; - case preempt_dynamic_full: preempt_dynamic_disable(cond_resched); preempt_dynamic_disable(might_resched); @@ -8033,11 +7980,7 @@ __setup("preempt=3D", setup_preempt_mode); static void __init preempt_dynamic_init(void) { if (preempt_dynamic_mode =3D=3D preempt_dynamic_undefined) { - if (IS_ENABLED(CONFIG_PREEMPT_NONE)) { - sched_dynamic_update(preempt_dynamic_none); - } else if (IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY)) { - sched_dynamic_update(preempt_dynamic_voluntary); - } else if (IS_ENABLED(CONFIG_PREEMPT_LAZY)) { + if (IS_ENABLED(CONFIG_PREEMPT_LAZY)) { sched_dynamic_update(preempt_dynamic_lazy); } else { /* Default static call setting, nothing to do */ --=20 2.30.2 From nobody Fri Oct 2 07:46:14 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 689CF437115 for ; Mon, 3 Aug 2026 19:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784676; cv=none; b=qCAtjscHAR2o52izlgVaXuB9NxrzZFdIm3EhFCXFt9OTcyJpcgDg2CbM99tXyHTq7RB0a6EL2cmTnn5AJWtnrjrap5Xh636evhZQ4L9pIFsLF5BO+cOKbNQdGFq7oZyUVnf+zPmxD2VP1nQgH5o/S6D/4NZCfPCYRTChAuEUKy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784676; c=relaxed/simple; bh=Y0hy6lr00h0hmz7YPedZEPM5O4s5B2JXRhHTMqIKbFQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SV8Em61XHl4gT1T4oF01BbIhV1ah2RWQVqHixNj8rJNbzzvYi/vE7te8SL9kb/uKYSg9Cq9qnlHUqlAB5PTIGtya2e/UsRZ7i98Nxl7eR178WIexfSGQ4ECmCnbYNQaQAZYvbDAfdPmo5k2XfnO+l9QMDqfiJV/5EWEcLzYC9P4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=q+DM0cQ5; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="q+DM0cQ5" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A6DA31596; Mon, 3 Aug 2026 12:17:49 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CB8303F632; Mon, 3 Aug 2026 12:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785784673; bh=Y0hy6lr00h0hmz7YPedZEPM5O4s5B2JXRhHTMqIKbFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+DM0cQ5huAuPju5LvJUUL+zPYDEEu89LQBqfsghlXz1cmmtIIJCO0x4KFxpK0eEY XdQ5GvYP0GdqxQTdqjTRk462pH2Ah1laKGhX3gXNEvAItWS1fddt+tHCcwuYjARr1R xvXH69J7dxp0Ky7pGSasPDCPXDJfNiI1C6DYRwwk= From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mark.rutland@arm.com, meted@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, ruanjinjie@huawei.com, sshegde@linux.ibm.com, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com Subject: [PATCH v2 2/6] sched: dynamic: Simplify {cond,might}_resched() Date: Mon, 3 Aug 2026 20:17:27 +0100 Message-Id: <20260803191731.3244294-3-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com> References: <20260803191731.3244294-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" PREEMPT_DYNAMIC is now limited to the FULL and LAZY preemption models. In either model, both cond_resched() and might_resched() are always disabled and do nothing. Remove the unnecessary code for these when PREEMPT_DYNAMIC is selected. Signed-off-by: Mark Rutland Reviewed-by: Shrikanth Hegde Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: John Stultz Cc: Juri Lelli Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Guittot Reviewed-by: Jinjie Ruan Tested-by: Jinjie Ruan Tested-by: Mete Durlu Tested-by: Shrikanth Hegde --- include/linux/kernel.h | 20 ------------------- include/linux/sched.h | 31 +++-------------------------- kernel/sched/core.c | 44 +----------------------------------------- 3 files changed, 4 insertions(+), 91 deletions(-) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e5570a16cbb1a..533ee1e6e1cb7 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -43,30 +43,10 @@ struct completion; struct user; =20 #ifdef CONFIG_PREEMPT_VOLUNTARY_BUILD - extern int __cond_resched(void); # define might_resched() __cond_resched() - -#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAM= IC_CALL) - -extern int __cond_resched(void); - -DECLARE_STATIC_CALL(might_resched, __cond_resched); - -static __always_inline void might_resched(void) -{ - static_call_mod(might_resched)(); -} - -#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAM= IC_KEY) - -extern int dynamic_might_resched(void); -# define might_resched() dynamic_might_resched() - #else - # define might_resched() do { } while (0) - #endif /* CONFIG_PREEMPT_* */ =20 #ifdef CONFIG_DEBUG_ATOMIC_SLEEP diff --git a/include/linux/sched.h b/include/linux/sched.h index 373bcc0598d10..1a44c5261c2dd 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2119,44 +2119,19 @@ static inline void set_need_resched_current(void) * value indicates whether a reschedule was done in fact. * cond_resched_lock() will drop the spinlock before scheduling, */ -#if !defined(CONFIG_PREEMPTION) || defined(CONFIG_PREEMPT_DYNAMIC) +#if !defined(CONFIG_PREEMPTION) extern int __cond_resched(void); =20 -#if defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC= _CALL) - -DECLARE_STATIC_CALL(cond_resched, __cond_resched); - -static __always_inline int _cond_resched(void) -{ - return static_call_mod(cond_resched)(); -} - -#elif defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAM= IC_KEY) - -extern int dynamic_cond_resched(void); - -static __always_inline int _cond_resched(void) -{ - return dynamic_cond_resched(); -} - -#else /* !CONFIG_PREEMPTION */ - static inline int _cond_resched(void) { return __cond_resched(); } - -#endif /* PREEMPT_DYNAMIC && CONFIG_HAVE_PREEMPT_DYNAMIC_CALL */ - -#else /* CONFIG_PREEMPTION && !CONFIG_PREEMPT_DYNAMIC */ - +#else static inline int _cond_resched(void) { return 0; } - -#endif /* !CONFIG_PREEMPTION || CONFIG_PREEMPT_DYNAMIC */ +#endif =20 #define cond_resched() ({ \ __might_resched(__FILE__, __LINE__, 0); \ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 2db78826a484b..84ec93694d718 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7733,7 +7733,7 @@ void rt_mutex_setprio(struct task_struct *p, struct t= ask_struct *pi_task) } #endif /* CONFIG_RT_MUTEXES */ =20 -#if !defined(CONFIG_PREEMPTION) || defined(CONFIG_PREEMPT_DYNAMIC) +#if !defined(CONFIG_PREEMPTION) int __sched __cond_resched(void) { if (should_resched(0) && !irqs_disabled()) { @@ -7761,38 +7761,6 @@ int __sched __cond_resched(void) EXPORT_SYMBOL(__cond_resched); #endif =20 -#ifdef CONFIG_PREEMPT_DYNAMIC -# ifdef CONFIG_HAVE_PREEMPT_DYNAMIC_CALL -# define cond_resched_dynamic_enabled __cond_resched -# define cond_resched_dynamic_disabled ((void *)&__static_call_return0) -DEFINE_STATIC_CALL_RET0(cond_resched, __cond_resched); -EXPORT_STATIC_CALL_TRAMP(cond_resched); - -# define might_resched_dynamic_enabled __cond_resched -# define might_resched_dynamic_disabled ((void *)&__static_call_return0) -DEFINE_STATIC_CALL_RET0(might_resched, __cond_resched); -EXPORT_STATIC_CALL_TRAMP(might_resched); -# elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) -static DEFINE_STATIC_KEY_FALSE(sk_dynamic_cond_resched); -int __sched dynamic_cond_resched(void) -{ - if (!static_branch_unlikely(&sk_dynamic_cond_resched)) - return 0; - return __cond_resched(); -} -EXPORT_SYMBOL(dynamic_cond_resched); - -static DEFINE_STATIC_KEY_FALSE(sk_dynamic_might_resched); -int __sched dynamic_might_resched(void) -{ - if (!static_branch_unlikely(&sk_dynamic_might_resched)) - return 0; - return __cond_resched(); -} -EXPORT_SYMBOL(dynamic_might_resched); -# endif -#endif /* CONFIG_PREEMPT_DYNAMIC */ - /* * __cond_resched_lock() - if a reschedule is pending, drop the given lock, * call schedule, and on return reacquire the lock. @@ -7862,8 +7830,6 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); # endif =20 /* - * SC:cond_resched - * SC:might_resched * SC:preempt_schedule * SC:preempt_schedule_notrace * SC:irqentry_exit_cond_resched @@ -7876,16 +7842,12 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); * (unselectable) * * FULL: - * cond_resched <- RET0 - * might_resched <- RET0 * preempt_schedule <- preempt_schedule * preempt_schedule_notrace <- preempt_schedule_notrace * irqentry_exit_cond_resched <- irqentry_exit_cond_resched * dynamic_preempt_lazy <- false * * LAZY: - * cond_resched <- RET0 - * might_resched <- RET0 * preempt_schedule <- preempt_schedule * preempt_schedule_notrace <- preempt_schedule_notrace * irqentry_exit_cond_resched <- irqentry_exit_cond_resched @@ -7932,8 +7894,6 @@ static void __sched_dynamic_update(int mode) { switch (mode) { case preempt_dynamic_full: - preempt_dynamic_disable(cond_resched); - preempt_dynamic_disable(might_resched); preempt_dynamic_enable(preempt_schedule); preempt_dynamic_enable(preempt_schedule_notrace); preempt_dynamic_enable(irqentry_exit_cond_resched); @@ -7943,8 +7903,6 @@ static void __sched_dynamic_update(int mode) break; =20 case preempt_dynamic_lazy: - preempt_dynamic_disable(cond_resched); - preempt_dynamic_disable(might_resched); preempt_dynamic_enable(preempt_schedule); preempt_dynamic_enable(preempt_schedule_notrace); preempt_dynamic_enable(irqentry_exit_cond_resched); --=20 2.30.2 From nobody Fri Oct 2 07:46:14 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 66753438025 for ; Mon, 3 Aug 2026 19:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784678; cv=none; b=hDF47wnXfHELet5XEo8FDW9X5SlxQb/FDAjic9NR0YATmNcFUGs2zIBybT4Zt6JiQ3jGAJp0U/vQU5BG0VQlmsPJ5yTRb2bxQP46KYbyI3hwGTSJ6DtrlUAXfrtuVRfaM90lPH0dnqcrcRPp/+A9Gx1g1fINh1jY1jRLcFAVnVU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784678; c=relaxed/simple; bh=+O4kjFqgfUo2UOOFFq10EhHo8UY3PBEuXfxudqJbJnA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Chti4oJ8Rho5vY1iDuW6i+SMQox8YeLbhdxWLa2yB/z+ZxbHY62prZ282R+xPI3ztAweg3rzg+dVEZ02GO5nBwxlBcV+m3+CtVmXWf6Tk7DVjJTetL2EY5YseTynonHWJi+wJEVO4vPh9DVboxuUz1EaiSaxL5JX6D3YKsCoHZk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=H8dL58Ek; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="H8dL58Ek" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EABAC15A1; Mon, 3 Aug 2026 12:17:51 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0F8073F632; Mon, 3 Aug 2026 12:17:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785784676; bh=+O4kjFqgfUo2UOOFFq10EhHo8UY3PBEuXfxudqJbJnA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H8dL58EkRb0vTR/gu61gMrq4NSDAXkmG4fghoPM4EYNDTwXPxQ4Xe4b3vSZhNrdg2 RbjHlSRc9LD1WG4QasleakqKCiJK3wb2zSr0ukZPhNo4l6cDEzAVbSfSbW5ypIwLvs 76TXdV2c4U4y92NUqFKR1v44U5KHNNHkOg75f88M= From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mark.rutland@arm.com, meted@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, ruanjinjie@huawei.com, sshegde@linux.ibm.com, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com Subject: [PATCH v2 3/6] sched: dynamic: Simplify preempt_schedule{,_notrace}() Date: Mon, 3 Aug 2026 20:17:28 +0100 Message-Id: <20260803191731.3244294-4-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com> References: <20260803191731.3244294-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" PREEMPT_DYNAMIC is now limited to the FULL and LAZY preemption models. In either model, both preempt_schedule() and preempt_schedule_notrace() are always called and never disabled. Remove the unnecessary code for these when PREEMPT_DYNAMIC is selected. Signed-off-by: Mark Rutland Reviewed-by: Shrikanth Hegde Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: John Stultz Cc: Juri Lelli Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Guittot Reviewed-by: Jinjie Ruan Tested-by: Jinjie Ruan Tested-by: Mete Durlu Tested-by: Shrikanth Hegde --- arch/arm64/include/asm/preempt.h | 10 ------ arch/s390/include/asm/preempt.h | 11 ------- arch/x86/include/asm/preempt.h | 28 ----------------- include/asm-generic/preempt.h | 10 ------ kernel/sched/core.c | 52 -------------------------------- 5 files changed, 111 deletions(-) diff --git a/arch/arm64/include/asm/preempt.h b/arch/arm64/include/asm/pree= mpt.h index 932ea4b620428..506dab34dddb2 100644 --- a/arch/arm64/include/asm/preempt.h +++ b/arch/arm64/include/asm/preempt.h @@ -84,19 +84,9 @@ static inline bool should_resched(int preempt_offset) void preempt_schedule(void); void preempt_schedule_notrace(void); =20 -#ifdef CONFIG_PREEMPT_DYNAMIC - -void dynamic_preempt_schedule(void); -#define __preempt_schedule() dynamic_preempt_schedule() -void dynamic_preempt_schedule_notrace(void); -#define __preempt_schedule_notrace() dynamic_preempt_schedule_notrace() - -#else /* CONFIG_PREEMPT_DYNAMIC */ - #define __preempt_schedule() preempt_schedule() #define __preempt_schedule_notrace() preempt_schedule_notrace() =20 -#endif /* CONFIG_PREEMPT_DYNAMIC */ #endif /* CONFIG_PREEMPTION */ =20 #endif /* __ASM_PREEMPT_H */ diff --git a/arch/s390/include/asm/preempt.h b/arch/s390/include/asm/preemp= t.h index 6e5821bb047e2..797efcbfe394a 100644 --- a/arch/s390/include/asm/preempt.h +++ b/arch/s390/include/asm/preempt.h @@ -148,20 +148,9 @@ static __always_inline bool should_resched(int preempt= _offset) void preempt_schedule(void); void preempt_schedule_notrace(void); =20 -#ifdef CONFIG_PREEMPT_DYNAMIC - -void dynamic_preempt_schedule(void); -void dynamic_preempt_schedule_notrace(void); -#define __preempt_schedule() dynamic_preempt_schedule() -#define __preempt_schedule_notrace() dynamic_preempt_schedule_notrace() - -#else /* CONFIG_PREEMPT_DYNAMIC */ - #define __preempt_schedule() preempt_schedule() #define __preempt_schedule_notrace() preempt_schedule_notrace() =20 -#endif /* CONFIG_PREEMPT_DYNAMIC */ - #endif /* CONFIG_PREEMPTION */ =20 #endif /* __ASM_PREEMPT_H */ diff --git a/arch/x86/include/asm/preempt.h b/arch/x86/include/asm/preempt.h index 578441db09f0b..14002c2abff44 100644 --- a/arch/x86/include/asm/preempt.h +++ b/arch/x86/include/asm/preempt.h @@ -109,43 +109,15 @@ static __always_inline bool should_resched(int preemp= t_offset) extern asmlinkage void preempt_schedule(void); extern asmlinkage void preempt_schedule_thunk(void); =20 -#define preempt_schedule_dynamic_enabled preempt_schedule_thunk -#define preempt_schedule_dynamic_disabled NULL - extern asmlinkage void preempt_schedule_notrace(void); extern asmlinkage void preempt_schedule_notrace_thunk(void); =20 -#define preempt_schedule_notrace_dynamic_enabled preempt_schedule_notrace_= thunk -#define preempt_schedule_notrace_dynamic_disabled NULL - -#ifdef CONFIG_PREEMPT_DYNAMIC - -DECLARE_STATIC_CALL(preempt_schedule, preempt_schedule_dynamic_enabled); - -#define __preempt_schedule() \ -do { \ - __STATIC_CALL_MOD_ADDRESSABLE(preempt_schedule); \ - asm volatile ("call " STATIC_CALL_TRAMP_STR(preempt_schedule) : ASM_CALL_= CONSTRAINT); \ -} while (0) - -DECLARE_STATIC_CALL(preempt_schedule_notrace, preempt_schedule_notrace_dyn= amic_enabled); - -#define __preempt_schedule_notrace() \ -do { \ - __STATIC_CALL_MOD_ADDRESSABLE(preempt_schedule_notrace); \ - asm volatile ("call " STATIC_CALL_TRAMP_STR(preempt_schedule_notrace) : A= SM_CALL_CONSTRAINT); \ -} while (0) - -#else /* PREEMPT_DYNAMIC */ - #define __preempt_schedule() \ asm volatile ("call preempt_schedule_thunk" : ASM_CALL_CONSTRAINT); =20 #define __preempt_schedule_notrace() \ asm volatile ("call preempt_schedule_notrace_thunk" : ASM_CALL_CONSTRAINT= ); =20 -#endif /* PREEMPT_DYNAMIC */ - #endif /* PREEMPTION */ =20 #endif /* __ASM_PREEMPT_H */ diff --git a/include/asm-generic/preempt.h b/include/asm-generic/preempt.h index 51f8f3881523a..26309df2a42f3 100644 --- a/include/asm-generic/preempt.h +++ b/include/asm-generic/preempt.h @@ -82,19 +82,9 @@ static __always_inline bool should_resched(int preempt_o= ffset) extern asmlinkage void preempt_schedule(void); extern asmlinkage void preempt_schedule_notrace(void); =20 -#if defined(CONFIG_PREEMPT_DYNAMIC) && defined(CONFIG_HAVE_PREEMPT_DYNAMIC= _KEY) - -void dynamic_preempt_schedule(void); -void dynamic_preempt_schedule_notrace(void); -#define __preempt_schedule() dynamic_preempt_schedule() -#define __preempt_schedule_notrace() dynamic_preempt_schedule_notrace() - -#else /* !CONFIG_PREEMPT_DYNAMIC || !CONFIG_HAVE_PREEMPT_DYNAMIC_KEY*/ - #define __preempt_schedule() preempt_schedule() #define __preempt_schedule_notrace() preempt_schedule_notrace() =20 -#endif /* CONFIG_PREEMPT_DYNAMIC && CONFIG_HAVE_PREEMPT_DYNAMIC_KEY*/ #endif /* CONFIG_PREEMPTION */ =20 #endif /* __ASM_PREEMPT_H */ diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 84ec93694d718..f88b9ef70a0dd 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7439,27 +7439,6 @@ asmlinkage __visible void __sched notrace preempt_sc= hedule(void) NOKPROBE_SYMBOL(preempt_schedule); EXPORT_SYMBOL(preempt_schedule); =20 -#ifdef CONFIG_PREEMPT_DYNAMIC -# ifdef CONFIG_HAVE_PREEMPT_DYNAMIC_CALL -# ifndef preempt_schedule_dynamic_enabled -# define preempt_schedule_dynamic_enabled preempt_schedule -# define preempt_schedule_dynamic_disabled NULL -# endif -DEFINE_STATIC_CALL(preempt_schedule, preempt_schedule_dynamic_enabled); -EXPORT_STATIC_CALL_TRAMP(preempt_schedule); -# elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) -static DEFINE_STATIC_KEY_TRUE(sk_dynamic_preempt_schedule); -void __sched notrace dynamic_preempt_schedule(void) -{ - if (!static_branch_unlikely(&sk_dynamic_preempt_schedule)) - return; - preempt_schedule(); -} -NOKPROBE_SYMBOL(dynamic_preempt_schedule); -EXPORT_SYMBOL(dynamic_preempt_schedule); -# endif -#endif /* CONFIG_PREEMPT_DYNAMIC */ - /** * preempt_schedule_notrace - preempt_schedule called by tracing * @@ -7512,27 +7491,6 @@ asmlinkage __visible void __sched notrace preempt_sc= hedule_notrace(void) } EXPORT_SYMBOL_GPL(preempt_schedule_notrace); =20 -#ifdef CONFIG_PREEMPT_DYNAMIC -# if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) -# ifndef preempt_schedule_notrace_dynamic_enabled -# define preempt_schedule_notrace_dynamic_enabled preempt_schedule_notra= ce -# define preempt_schedule_notrace_dynamic_disabled NULL -# endif -DEFINE_STATIC_CALL(preempt_schedule_notrace, preempt_schedule_notrace_dyna= mic_enabled); -EXPORT_STATIC_CALL_TRAMP(preempt_schedule_notrace); -# elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) -static DEFINE_STATIC_KEY_TRUE(sk_dynamic_preempt_schedule_notrace); -void __sched notrace dynamic_preempt_schedule_notrace(void) -{ - if (!static_branch_unlikely(&sk_dynamic_preempt_schedule_notrace)) - return; - preempt_schedule_notrace(); -} -NOKPROBE_SYMBOL(dynamic_preempt_schedule_notrace); -EXPORT_SYMBOL(dynamic_preempt_schedule_notrace); -# endif -#endif - #endif /* CONFIG_PREEMPTION */ =20 /* @@ -7830,8 +7788,6 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); # endif =20 /* - * SC:preempt_schedule - * SC:preempt_schedule_notrace * SC:irqentry_exit_cond_resched * * @@ -7842,14 +7798,10 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); * (unselectable) * * FULL: - * preempt_schedule <- preempt_schedule - * preempt_schedule_notrace <- preempt_schedule_notrace * irqentry_exit_cond_resched <- irqentry_exit_cond_resched * dynamic_preempt_lazy <- false * * LAZY: - * preempt_schedule <- preempt_schedule - * preempt_schedule_notrace <- preempt_schedule_notrace * irqentry_exit_cond_resched <- irqentry_exit_cond_resched * dynamic_preempt_lazy <- true */ @@ -7894,8 +7846,6 @@ static void __sched_dynamic_update(int mode) { switch (mode) { case preempt_dynamic_full: - preempt_dynamic_enable(preempt_schedule); - preempt_dynamic_enable(preempt_schedule_notrace); preempt_dynamic_enable(irqentry_exit_cond_resched); preempt_dynamic_key_disable(preempt_lazy); if (mode !=3D preempt_dynamic_mode) @@ -7903,8 +7853,6 @@ static void __sched_dynamic_update(int mode) break; =20 case preempt_dynamic_lazy: - preempt_dynamic_enable(preempt_schedule); - preempt_dynamic_enable(preempt_schedule_notrace); preempt_dynamic_enable(irqentry_exit_cond_resched); preempt_dynamic_key_enable(preempt_lazy); if (mode !=3D preempt_dynamic_mode) --=20 2.30.2 From nobody Fri Oct 2 07:46:14 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EDF642A17D for ; Mon, 3 Aug 2026 19:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784681; cv=none; b=gk/mzCxY8Hlkxhf650vWjrsObVJgu6WG96aFDJwvQY9xPPCbwE6BjOCetlD5tqgwJfsCZ7QkrYpsi83ZahtDevq2EGCqvD3OaWfKKWggWEq9yi2I8eISVBhyZZvaF9a1QubHoKhhEH2oyz4PSWPTbarzsSFLlDG7OE5zLab2r0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784681; c=relaxed/simple; bh=mC6P0L0suGjOEM4ar5F+E3w8NMTLgD+oQcx5Lyes5i0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YqBRmpkEvbeiVYE7g9IQTvEN8Pj8lyMS4mnsS2dQ7XgWELPtryikqWvCJiK2lPTqhEU4zFyFH7o5ZZcDZr7bpOlQ5MnqeTiwn5/Xc5dh8fWLs68z/0N3TpM8lEHcIK4mE8QSs3aVuNm9KmGJv83DWoIsDLuB+hOL0X8dEAUkx7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=Pt0ykc2T; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="Pt0ykc2T" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 34D8B1655; Mon, 3 Aug 2026 12:17:54 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 550243F632; Mon, 3 Aug 2026 12:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785784678; bh=mC6P0L0suGjOEM4ar5F+E3w8NMTLgD+oQcx5Lyes5i0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pt0ykc2TiGbyGAvNk6gZRV/LyTw2Nhot4Mjz0Rbwt0Xw6QW3hDBevKAjiQ0ssta+A 6fPBDicAGEKMDv2iM8SbjEiw4BX8jGqCnfHrSGoTy3zb9idR4fvrg3bACNkrnOogfW GjNXX6pxmLz3IUvOOl8BKLfdk7+lAlzU2CwUFACE= From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mark.rutland@arm.com, meted@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, ruanjinjie@huawei.com, sshegde@linux.ibm.com, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com Subject: [PATCH v2 4/6] sched: dynamic: Simplify irqentry_exit_cond_resched() Date: Mon, 3 Aug 2026 20:17:29 +0100 Message-Id: <20260803191731.3244294-5-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com> References: <20260803191731.3244294-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" PREEMPT_DYNAMIC is now limited to the FULL and LAZY preemption models. In either model, irqentry_exit_cond_resched() is always called and never disabled. Remove the unnecessary code for this when PREEMPT_DYNAMIC is selected. Signed-off-by: Mark Rutland Reviewed-by: Shrikanth Hegde Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: John Stultz Cc: Juri Lelli Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Guittot Reviewed-by: Jinjie Ruan Tested-by: Jinjie Ruan Tested-by: Mete Durlu Tested-by: Shrikanth Hegde --- include/linux/irq-entry-common.h | 17 +---------------- kernel/entry/common.c | 17 ++--------------- kernel/sched/core.c | 7 ------- 3 files changed, 3 insertions(+), 38 deletions(-) diff --git a/include/linux/irq-entry-common.h b/include/linux/irq-entry-com= mon.h index 1fabf0f5ea8e7..de7e10de91d04 100644 --- a/include/linux/irq-entry-common.h +++ b/include/linux/irq-entry-common.h @@ -346,22 +346,7 @@ typedef struct irqentry_state { * * Conditional reschedule with additional sanity checks. */ -void raw_irqentry_exit_cond_resched(void); - -#ifdef CONFIG_PREEMPT_DYNAMIC -#if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) -#define irqentry_exit_cond_resched_dynamic_enabled raw_irqentry_exit_cond_= resched -#define irqentry_exit_cond_resched_dynamic_disabled NULL -DECLARE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_res= ched); -#define irqentry_exit_cond_resched() static_call(irqentry_exit_cond_resche= d)() -#elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) -DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched); -void dynamic_irqentry_exit_cond_resched(void); -#define irqentry_exit_cond_resched() dynamic_irqentry_exit_cond_resched() -#endif -#else /* CONFIG_PREEMPT_DYNAMIC */ -#define irqentry_exit_cond_resched() raw_irqentry_exit_cond_resched() -#endif /* CONFIG_PREEMPT_DYNAMIC */ +void irqentry_exit_cond_resched(void); =20 /** * irqentry_enter_from_kernel_mode - Establish state before invoking the i= rq handler diff --git a/kernel/entry/common.c b/kernel/entry/common.c index e3d381fd3d251..e234b04373fea 100644 --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@ -123,7 +123,7 @@ noinstr irqentry_state_t irqentry_enter(struct pt_regs = *regs) /** * arch_irqentry_exit_need_resched - Architecture specific need resched fu= nction * - * Invoked from raw_irqentry_exit_cond_resched() to check if resched is ne= eded. + * Invoked from irqentry_exit_cond_resched() to check if resched is needed. * Defaults return true. * * The main purpose is to permit arch to avoid preemption of a task from a= n IRQ. @@ -134,7 +134,7 @@ static inline bool arch_irqentry_exit_need_resched(void= ); static inline bool arch_irqentry_exit_need_resched(void) { return true; } #endif =20 -void raw_irqentry_exit_cond_resched(void) +void irqentry_exit_cond_resched(void) { if (!preempt_count()) { /* Sanity check RCU and thread stack */ @@ -145,19 +145,6 @@ void raw_irqentry_exit_cond_resched(void) preempt_schedule_irq(); } } -#ifdef CONFIG_PREEMPT_DYNAMIC -#if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) -DEFINE_STATIC_CALL(irqentry_exit_cond_resched, raw_irqentry_exit_cond_resc= hed); -#elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) -DEFINE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched); -void dynamic_irqentry_exit_cond_resched(void) -{ - if (!static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched)) - return; - raw_irqentry_exit_cond_resched(); -} -#endif -#endif =20 noinstr void irqentry_exit(struct pt_regs *regs, irqentry_state_t state) { diff --git a/kernel/sched/core.c b/kernel/sched/core.c index f88b9ef70a0dd..4f754f4a472f8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7788,9 +7788,6 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); # endif =20 /* - * SC:irqentry_exit_cond_resched - * - * * NONE: * (unselectable) * @@ -7798,11 +7795,9 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); * (unselectable) * * FULL: - * irqentry_exit_cond_resched <- irqentry_exit_cond_resched * dynamic_preempt_lazy <- false * * LAZY: - * irqentry_exit_cond_resched <- irqentry_exit_cond_resched * dynamic_preempt_lazy <- true */ =20 @@ -7846,14 +7841,12 @@ static void __sched_dynamic_update(int mode) { switch (mode) { case preempt_dynamic_full: - preempt_dynamic_enable(irqentry_exit_cond_resched); preempt_dynamic_key_disable(preempt_lazy); if (mode !=3D preempt_dynamic_mode) pr_info("Dynamic Preempt: full\n"); break; =20 case preempt_dynamic_lazy: - preempt_dynamic_enable(irqentry_exit_cond_resched); preempt_dynamic_key_enable(preempt_lazy); if (mode !=3D preempt_dynamic_mode) pr_info("Dynamic Preempt: lazy\n"); --=20 2.30.2 From nobody Fri Oct 2 07:46:14 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A60F5439349 for ; Mon, 3 Aug 2026 19:18:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784684; cv=none; b=rdDNlZjK0FihCmJcGXU5hsM7odjZot3NpVQ+1Za05GZjDM+O3nEsDUCg36N/7p7yF+JEIZoDMOWJH0VrHAq9/gX7E92lecOEWqv0RTEVQCqOgOvkPjBrUmdHS6opeEqCvVJz6wMxf/bENqwqLLY1kGWkfr43PeAQpEgz8HzFhBA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784684; c=relaxed/simple; bh=DdYTJJPCh/v6yt7ghDw/rVcuhvaGBIHcKrnnXRCHyBc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GlgW2TYt45RpP4N16k1LAamr8oXUYKWT1gXrGhZg1YAHkkjiU8YY1PyPB6KSl8S9EyLn+sMIbTEA4GJ9AQdrLvh/ObYOOE3eQVdUdt+d9D1BCs7tZpA4RetirnMyF8Gx7P2Uvtb4eRUPDcbpYjWWnICB2wyAGitPgebLpULknK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=Ha9ldgWI; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="Ha9ldgWI" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6FB98165C; Mon, 3 Aug 2026 12:17:56 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 901343F632; Mon, 3 Aug 2026 12:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785784680; bh=DdYTJJPCh/v6yt7ghDw/rVcuhvaGBIHcKrnnXRCHyBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ha9ldgWIgICPL9XrejydsIZbizD6IDDkMWciAI2gDM3ziNJmVwxPRiqlWkgtqyNmG WPZXgNKrXNY8VRoVBKlP/+CNdGMhrXlYvkR3kdwHZiHmXsclJ81jyw90nNVOI6dWGF 4H6zDbRd6P1HzeXiWVOfTQVK+21XumZ61UiMMNEQ= From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mark.rutland@arm.com, meted@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, ruanjinjie@huawei.com, sshegde@linux.ibm.com, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com Subject: [PATCH v2 5/6] sched: dynamic: Remove HAVE_PREEMPT_DYNAMIC_{CALL,KEY} Date: Mon, 3 Aug 2026 20:17:30 +0100 Message-Id: <20260803191731.3244294-6-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com> References: <20260803191731.3244294-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Mark Rutland Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: John Stultz Cc: Juri Lelli Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Guittot Reviewed-by: Jinjie Ruan Reviewed-by: Shrikanth Hegde Tested-by: Jinjie Ruan Tested-by: Mete Durlu Tested-by: Shrikanth Hegde --- arch/Kconfig | 38 -------------------------------------- arch/arm64/Kconfig | 1 - arch/loongarch/Kconfig | 1 - arch/powerpc/Kconfig | 1 - arch/riscv/Kconfig | 1 - arch/s390/Kconfig | 1 - arch/x86/Kconfig | 1 - kernel/Kconfig.preempt | 8 ++------ kernel/sched/core.c | 10 ---------- 9 files changed, 2 insertions(+), 60 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index fa7507ac8e13e..16e46010922a5 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -1696,44 +1696,6 @@ config HAVE_STATIC_CALL_INLINE depends on HAVE_STATIC_CALL select OBJTOOL =20 -config HAVE_PREEMPT_DYNAMIC - bool - -config HAVE_PREEMPT_DYNAMIC_CALL - bool - depends on HAVE_STATIC_CALL - select HAVE_PREEMPT_DYNAMIC - help - An architecture should select this if it can handle the preemption - model being selected at boot time using static calls. - - Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a - preemption function will be patched directly. - - Where an architecture does not select HAVE_STATIC_CALL_INLINE, any - call to a preemption function will go through a trampoline, and the - trampoline will be patched. - - It is strongly advised to support inline static call to avoid any - overhead. - -config HAVE_PREEMPT_DYNAMIC_KEY - bool - depends on HAVE_ARCH_JUMP_LABEL - select HAVE_PREEMPT_DYNAMIC - help - An architecture should select this if it can handle the preemption - model being selected at boot time using static keys. - - Each preemption function will be given an early return based on a - static key. This should have slightly lower overhead than non-inline - static calls, as this effectively inlines each trampoline into the - start of its callee. This may avoid redundant work, and may - integrate better with CFI schemes. - - This will have greater overhead than using inline static calls as - the call to the preemption function cannot be entirely elided. - config ARCH_WANT_LD_ORPHAN_WARN bool help diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index b3afe0688919b..1504bc354b9e5 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -216,7 +216,6 @@ config ARM64 select HAVE_PERF_EVENTS_NMI if ARM64_PSEUDO_NMI select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP - select HAVE_PREEMPT_DYNAMIC_KEY select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE select HAVE_POSIX_CPU_TIMERS_TASK_WORK diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig index d8d2523250179..1889d808597da 100644 --- a/arch/loongarch/Kconfig +++ b/arch/loongarch/Kconfig @@ -170,7 +170,6 @@ config LOONGARCH select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP select HAVE_POSIX_CPU_TIMERS_TASK_WORK - select HAVE_PREEMPT_DYNAMIC_KEY select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE if UNWINDER_ORC select HAVE_RETHOOK diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index f7ce5fff81f03..940f8fbea55c5 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -280,7 +280,6 @@ config PPC select HAVE_PERF_EVENTS_NMI if PPC64 select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP - select HAVE_PREEMPT_DYNAMIC_KEY select HAVE_RETHOOK if KPROBES select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index f7028caaeae06..9c1207a0cbcb9 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -193,7 +193,6 @@ config RISCV select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP select HAVE_POSIX_CPU_TIMERS_TASK_WORK - select HAVE_PREEMPT_DYNAMIC_KEY select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RETHOOK select HAVE_RSEQ diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 84404e6778d50..ad527859694ab 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -239,7 +239,6 @@ config S390 select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP select HAVE_POSIX_CPU_TIMERS_TASK_WORK - select HAVE_PREEMPT_DYNAMIC_KEY select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RELIABLE_STACKTRACE select HAVE_RETHOOK diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bdad90f210e4b..b05ffa8f661b4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -294,7 +294,6 @@ config X86 select HAVE_STACK_VALIDATION if HAVE_OBJTOOL select HAVE_STATIC_CALL select HAVE_STATIC_CALL_INLINE if HAVE_OBJTOOL - select HAVE_PREEMPT_DYNAMIC_CALL select HAVE_RSEQ select HAVE_RUST if X86_64 select HAVE_SYSCALL_TRACEPOINTS 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 =20 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 select PREEMPT_BUILD - default y if HAVE_PREEMPT_DYNAMIC_CALL + default y help This option allows to define the preemption model on the kernel command line parameter and thus override the default preemption @@ -142,9 +140,7 @@ config PREEMPT_DYNAMIC provide a pre-built kernel binary to reduce the number of kernel flavors they offer while still offering different usecases. =20 - The runtime overhead is negligible with HAVE_STATIC_CALL_INLINE enabled - but if runtime patching is not available for the specific architecture - then the potential overhead should be considered. + The runtime overhead is negligible. =20 Interesting if you want the same pre-built kernel should be used for both Server and Desktop workloads. diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4f754f4a472f8..7b815d8ce67d3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7825,16 +7825,6 @@ int sched_dynamic_mode(const char *str) # define preempt_dynamic_key_enable(f) static_key_enable(&sk_dynamic_##f.k= ey) # define preempt_dynamic_key_disable(f) static_key_disable(&sk_dynamic_##f= .key) =20 -# if defined(CONFIG_HAVE_PREEMPT_DYNAMIC_CALL) -# define preempt_dynamic_enable(f) static_call_update(f, f##_dynamic_enab= led) -# define preempt_dynamic_disable(f) static_call_update(f, f##_dynamic_dis= abled) -# elif defined(CONFIG_HAVE_PREEMPT_DYNAMIC_KEY) -# define preempt_dynamic_enable(f) preempt_dynamic_key_enable(f) -# define preempt_dynamic_disable(f) preempt_dynamic_key_disable(f) -# else -# error "Unsupported PREEMPT_DYNAMIC mechanism" -# endif - static DEFINE_MUTEX(sched_dynamic_mutex); =20 static void __sched_dynamic_update(int mode) --=20 2.30.2 From nobody Fri Oct 2 07:46:14 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F43743553A for ; Mon, 3 Aug 2026 19:18:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784685; cv=none; b=TV1DyWVqn9JDbdKJkgyPGxVXQjiHGyWJ+umJnZW5NEQqcPHkPmwtKAO5gGCB4vF452kW9Tf/xEpnQcDjZGjehiJ8tsFg1CM9rFwfUlT2tRzT5C3h77nU8lddNITpbKMaZKJ2/xPELBaSHtjPFMXuEw/XIgEcrBqM+3YHLQ2i1G4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785784685; c=relaxed/simple; bh=kepVc1+bEjeJXn/nFaWnz09wtUqciqLEa8HMXqOoxIg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NKrhHSkLVKQLTDwISVZBNI9fcL9vqx2hba73wCmeb9emTvhRYyxFZ0tw+lpz57Npn3vMddUlSNtKAMXcZQb8+Wi+03i9XhWko1C/Oc2VfyZOoOtu/Xn5VqJ3+s+eyPdG1OQsA7KpNvw0yfJuVrHkPX2TW3wAmXgqLhmKjq6uX2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=g0IJxame; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="g0IJxame" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5678143D; Mon, 3 Aug 2026 12:17:58 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CA0AB3F632; Mon, 3 Aug 2026 12:18:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1785784682; bh=kepVc1+bEjeJXn/nFaWnz09wtUqciqLEa8HMXqOoxIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g0IJxamex71RJhV8SrcqyHB0SdfJ8SqIhFz4PSTzLiYSROuVjQlkZ1LdOkKdiHar3 SkTF6LC6fJWDl098DOwDkGQoKuK7kesWrAXnTgQf6nK1FaUtJ37JI9HNp4/cpvubew idbrBbirQL1Vn+FZ5GDIwtReGNujtJR3EGrUD5No= From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: frederic@kernel.org, jstultz@google.com, juri.lelli@redhat.com, mark.rutland@arm.com, meted@linux.ibm.com, mingo@redhat.com, peterz@infradead.org, ruanjinjie@huawei.com, sshegde@linux.ibm.com, tglx@linutronix.de, vincent.guittot@linaro.org, vschneid@redhat.com Subject: [PATCH v2 6/6] sched: dynamic: Simplify preempt model accessors Date: Mon, 3 Aug 2026 20:17:31 +0100 Message-Id: <20260803191731.3244294-7-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20260803191731.3244294-1-mark.rutland@arm.com> References: <20260803191731.3244294-1-mark.rutland@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" PREEMPT_DYNAMIC is now limited to the FULL and LAZY preemption models. When CONFIG_PREEMPT_DYNAMIC=3Dy, the NONE and VOLUNTARY models cannot be used, and neither CONFIG_PREEMPT_NONE nor CONFIG_PREEMPT_VOLUNTARY can be selected. Simplify the preempt model accessors accordingly: remove the out-of-line implementations of preempt_model_none() and preempt_model_voluntary(), and remove the preempt_dynamic_{none,voluntary} values. There are no current users of preempt_model_voluntary(), but I've kept it around for consistency, with every scheduler model having its own preempt_model_*() accessor. Suggested-by: Shrikanth Hegde Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: John Stultz Cc: Juri Lelli Cc: Peter Zijlstra Cc: Shrikanth Hegde Cc: Thomas Gleixner Cc: Valentin Schneider Cc: Vincent Guittot Reviewed-by: Jinjie Ruan Reviewed-by: Shrikanth Hegde Tested-by: Jinjie Ruan Tested-by: Mete Durlu Tested-by: Shrikanth Hegde --- include/linux/preempt.h | 20 ++++++++++---------- kernel/sched/core.c | 4 ---- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/linux/preempt.h b/include/linux/preempt.h index d964f965c8ffc..7e2ec8e29c83f 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h @@ -470,21 +470,11 @@ DEFINE_LOCK_GUARD_0(preempt_notrace, preempt_disable_= notrace(), preempt_enable_n =20 #ifdef CONFIG_PREEMPT_DYNAMIC =20 -extern bool preempt_model_none(void); -extern bool preempt_model_voluntary(void); extern bool preempt_model_full(void); extern bool preempt_model_lazy(void); =20 #else =20 -static inline bool preempt_model_none(void) -{ - return IS_ENABLED(CONFIG_PREEMPT_NONE); -} -static inline bool preempt_model_voluntary(void) -{ - return IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY); -} static inline bool preempt_model_full(void) { return IS_ENABLED(CONFIG_PREEMPT); @@ -497,6 +487,16 @@ static inline bool preempt_model_lazy(void) =20 #endif =20 +static inline bool preempt_model_none(void) +{ + return IS_ENABLED(CONFIG_PREEMPT_NONE); +} + +static inline bool preempt_model_voluntary(void) +{ + return IS_ENABLED(CONFIG_PREEMPT_VOLUNTARY); +} + static inline bool preempt_model_rt(void) { return IS_ENABLED(CONFIG_PREEMPT_RT); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7b815d8ce67d3..4026f2399edf3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7803,8 +7803,6 @@ EXPORT_SYMBOL(__cond_resched_rwlock_write); =20 enum { preempt_dynamic_undefined =3D -1, - preempt_dynamic_none, - preempt_dynamic_voluntary, preempt_dynamic_full, preempt_dynamic_lazy, }; @@ -7889,8 +7887,6 @@ static void __init preempt_dynamic_init(void) } \ EXPORT_SYMBOL_GPL(preempt_model_##mode) =20 -PREEMPT_MODEL_ACCESSOR(none); -PREEMPT_MODEL_ACCESSOR(voluntary); PREEMPT_MODEL_ACCESSOR(full); PREEMPT_MODEL_ACCESSOR(lazy); =20 --=20 2.30.2