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

From: Shrikanth Hegde

Date: Fri Jul 17 2026 - 09:50:00 EST


Hi Mark,

On 7/17/26 4:35 PM, Mark Rutland wrote:
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://lore.kernel.org/all/2bf10a0afffefb6aca44bf2f864cc17471a80e31.1781870889.git.chleroy@xxxxxxxxxx/

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 will go by Christophe preference.

But i see it is in powerpc fixes branch and part of pull request.
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=fixes

So, you might have to rebase on top of it.


[...]

Change per se, looks good to me.

Reviewed-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>

Thanks!

Mark.