From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Peter Zijlstra <peterz@infradead.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>
Subject: Re: [PATCH] powerpc: Remove dead non-preemption code
Date: Fri, 19 Jun 2026 18:31:38 +0530 [thread overview]
Message-ID: <00f9f432-7a09-402d-80d8-3537829af07a@linux.ibm.com> (raw)
In-Reply-To: <2bf10a0afffefb6aca44bf2f864cc17471a80e31.1781870889.git.chleroy@kernel.org>
Hi Christophe.
On 6/19/26 5:38 PM, Christophe Leroy (CS GROUP) wrote:
> Since commit 7dadeaa6e851 ("sched: Further restrict the preemption
> modes"), powerpc always has CONFIG_PREEMPTION because only
> CONFIG_PREEMPT and CONFIG_PREEMPT_LAZY are possible, even in
> dynamic preemption mode (see sched_dynamic_mode).
>
> As a consequence, need_irq_preemption() is always true and can be
> removed.
right. this can be removed now.
Thanks for the cleanup.
>
> And because commit bee25f97ad24 ("powerpc: Enable GENERIC_ENTRY
> feature") includes linux/irq-entry-common.h which already declares
> sk_dynamic_irqentry_exit_cond_resched static key, asm/preempt.h
> becauses useless and can be removed.
s/becauses/becomes
> Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
> ---
> arch/powerpc/include/asm/preempt.h | 16 ----------------
> arch/powerpc/lib/vmx-helper.c | 2 +-
> 2 files changed, 1 insertion(+), 17 deletions(-)
> delete mode 100644 arch/powerpc/include/asm/preempt.h
>
> diff --git a/arch/powerpc/include/asm/preempt.h b/arch/powerpc/include/asm/preempt.h
> deleted file mode 100644
> index 000e2b9681f3..000000000000
> --- a/arch/powerpc/include/asm/preempt.h
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef __ASM_POWERPC_PREEMPT_H
> -#define __ASM_POWERPC_PREEMPT_H
> -
> -#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
> -
> -#endif /* __ASM_POWERPC_PREEMPT_H */
> diff --git a/arch/powerpc/lib/vmx-helper.c b/arch/powerpc/lib/vmx-helper.c
> index 57e897b60db8..cc9fb72cb4eb 100644
> --- a/arch/powerpc/lib/vmx-helper.c
> +++ b/arch/powerpc/lib/vmx-helper.c
> @@ -46,7 +46,7 @@ int exit_vmx_usercopy(void)
> * set and we are preemptible. The hack here is to schedule a
> * decrementer to fire here and reschedule for us if necessary.
> */
> - if (need_irq_preemption() && need_resched())
> + if (need_resched())
> set_dec(1);
> return 0;
> }
I booted with the patch, still can change between lazy/full.
So,
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
prev parent reply other threads:[~2026-06-19 13:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-19 12:08 [PATCH] powerpc: Remove dead non-preemption code Christophe Leroy (CS GROUP)
2026-06-19 13:01 ` Shrikanth Hegde [this message]
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=00f9f432-7a09-402d-80d8-3537829af07a@linux.ibm.com \
--to=sshegde@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox