Re: [PATCH 4/5] sched: dynamic: Simplify irqentry_exit_cond_resched()

From: Christophe Leroy (CS GROUP)

Date: Mon Jul 27 2026 - 07:32:24 EST


Hi Mark,

Le 17/07/2026 à 13:05, Mark Rutland a écrit :
On Mon, Jul 06, 2026 at 10:12:29AM +0530, Shrikanth Hegde wrote:
+cc Christophe.

On 7/3/26 7:03 PM, Mark Rutland wrote:
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 <mark.rutland@xxxxxxx>
Cc: Frederic Weisbecker <frederic@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: John Stultz <jstultz@xxxxxxxxxx>
Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Valentin Schneider <vschneid@xxxxxxxxxx>
Cc: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
---
arch/powerpc/include/asm/preempt.h | 7 -------
include/linux/irq-entry-common.h | 17 +----------------
kernel/entry/common.c | 17 ++---------------
kernel/sched/core.c | 7 -------
4 files changed, 3 insertions(+), 45 deletions(-)

diff --git a/arch/powerpc/include/asm/preempt.h b/arch/powerpc/include/asm/preempt.h
index 000e2b9681f30..79fc1f9df88d9 100644
--- a/arch/powerpc/include/asm/preempt.h
+++ b/arch/powerpc/include/asm/preempt.h
@@ -4,13 +4,6 @@
#include <asm-generic/preempt.h>
-#if defined(CONFIG_PREEMPT_DYNAMIC)
-#include <linux/jump_label.h>
-DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched);
-#define need_irq_preemption() \
- (static_branch_unlikely(&sk_dynamic_irqentry_exit_cond_resched))
-#else
#define need_irq_preemption() (IS_ENABLED(CONFIG_PREEMPTION))
-#endif

JFYI,
Christophe had sent this patch, I am sure you guys will sort out the
conflicts. (I don't see it merged yet, but likely might)

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fall%2F2bf10a0afffefb6aca44bf2f864cc17471a80e31.1781870889.git.chleroy%40kernel.org%2F&data=05%7C02%7Cchristophe.leroy%40csgroup.eu%7Cd53a0ccd869f471aaafe08dee3f345aa%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639198831155344265%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Uz61UVryN4sw1GprTddsVCFvEkuXguHZufVNJr0PpeY%3D&reserved=0

Thanks for the heads-up!

Sorry, I'd skipped Ccing all the arch folk as I hadn't expected anyone
was likely to be doing similar in the arch code right now. I'll make
sure you're both Cc'd for any subsequent versions.

It looks like the only difference for powerpc is that I leave
need_irq_preemption() lying around. Christophe, if you're happy with
this series, I could pick a patch from you to remove that (e.g. take
your patch and apply it to the end of this series, reduced to removing
need_irq_preemption()).

Any preference?

I'm just back from summer vacation.

No preference, but it looks like my patch was merged into v7.2-rc4 as commit a2c02aa0c6ca ("powerpc: Remove dead non-preemption code"), so I fear you'll need to rebase your work on top of it.

Christophe


[...]

Change per se, looks good to me.

Reviewed-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>

Thanks!

Mark.