[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z6nrhhtTKQpScUd0@J2N7QTR9R3>
Date: Mon, 10 Feb 2025 12:05:26 +0000
From: Mark Rutland <mark.rutland@....com>
To: Jinjie Ruan <ruanjinjie@...wei.com>
Cc: catalin.marinas@....com, will@...nel.org, oleg@...hat.com,
sstabellini@...nel.org, tglx@...utronix.de, peterz@...radead.org,
luto@...nel.org, mingo@...hat.com, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
vschneid@...hat.com, kees@...nel.org, wad@...omium.org,
akpm@...ux-foundation.org, samitolvanen@...gle.com,
masahiroy@...nel.org, hca@...ux.ibm.com, aliceryhl@...gle.com,
rppt@...nel.org, xur@...gle.com, paulmck@...nel.org, arnd@...db.de,
mbenes@...e.cz, puranjay@...nel.org, pcc@...gle.com,
ardb@...nel.org, sudeep.holla@....com, guohanjun@...wei.com,
rafael@...nel.org, liuwei09@...tc.cn, dwmw@...zon.co.uk,
Jonathan.Cameron@...wei.com, liaochang1@...wei.com,
kristina.martsenko@....com, ptosi@...gle.com, broonie@...nel.org,
thiago.bauermann@...aro.org, kevin.brodsky@....com,
joey.gouly@....com, liuyuntao12@...wei.com, leobras@...hat.com,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH -next v5 10/22] entry: Add
arch_irqentry_exit_need_resched() for arm64
On Fri, Dec 06, 2024 at 06:17:32PM +0800, Jinjie Ruan wrote:
> ARM64 requires an additional check whether to reschedule on return
> from interrupt.
>
> Add arch_irqentry_exit_need_resched() as the default NOP
> implementation and hook it up into the need_resched() condition in
> raw_irqentry_exit_cond_resched().
>
> This allows ARM64 to implement the architecture specific version for
> switching over to the generic entry code.
Please fold this into the earlier changes in this area mad over patches
6 to 8.
>
> Suggested-by: Mark Rutland <mark.rutland@....com>
> Suggested-by: Kevin Brodsky <kevin.brodsky@....com>
> Suggested-by: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Jinjie Ruan <ruanjinjie@...wei.com>
> ---
> kernel/entry/common.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/entry/common.c b/kernel/entry/common.c
> index b82032777310..4aa9656fa1b4 100644
> --- a/kernel/entry/common.c
> +++ b/kernel/entry/common.c
> @@ -142,6 +142,20 @@ noinstr irqentry_state_t irqentry_enter(struct pt_regs *regs)
> return ret;
> }
>
> +/**
> + * arch_irqentry_exit_need_resched - Architecture specific need resched function
> + *
> + * Invoked from raw_irqentry_exit_cond_resched() to check if need resched.
> + * Defaults return true.
> + *
> + * The main purpose is to permit arch to skip preempt a task from an IRQ.
> + */
> +static inline bool arch_irqentry_exit_need_resched(void);
> +
> +#ifndef arch_irqentry_exit_need_resched
> +static inline bool arch_irqentry_exit_need_resched(void) { return true; }
> +#endif
> +
> void raw_irqentry_exit_cond_resched(void)
> {
> if (!preempt_count()) {
> @@ -149,7 +163,7 @@ void raw_irqentry_exit_cond_resched(void)
> rcu_irq_exit_check_preempt();
> if (IS_ENABLED(CONFIG_DEBUG_ENTRY))
> WARN_ON_ONCE(!on_thread_stack());
> - if (need_resched())
> + if (need_resched() && arch_irqentry_exit_need_resched())
> preempt_schedule_irq();
> }
> }
> --
> 2.34.1
>
Powered by blists - more mailing lists