From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Shrikanth Hegde <sshegde@linux.ibm.com>
Cc: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,
npiggin@gmail.com, maddy@linux.ibm.com,
christophe.leroy@csgroup.eu, peterz@infradead.org,
ankur.a.arora@oracle.com
Subject: Re: [PATCH] powerpc: Add preempt lazy support
Date: Fri, 8 Nov 2024 11:50:31 +0100 [thread overview]
Message-ID: <20241108105031.Uq8MV60I@linutronix.de> (raw)
In-Reply-To: <20241108101853.277808-1-sshegde@linux.ibm.com>
On 2024-11-08 15:48:53 [+0530], Shrikanth Hegde wrote:
> Define preempt lazy bit for Powerpc. Use bit 9 which is free and within
> 16 bit range of NEED_RESCHED, so compiler can issue single andi.
>
> Since Powerpc doesn't use the generic entry/exit, add lazy check at exit
> to user. CONFIG_PREEMPTION is defined for lazy/full/rt so use it for
> return to kernel.
>
> Ran a few benchmarks and db workload on Power10. Performance is close to
> preempt=none/voluntary. It is possible that some patterns would
> differ in lazy[2]. More details of preempt lazy is here [1]
>
> Since Powerpc system can have large core count and large memory,
> preempt lazy is going to be helpful in avoiding soft lockup issues.
>
> [1]: https://lore.kernel.org/lkml/20241007074609.447006177@infradead.org/
> [2]: https://lore.kernel.org/all/1a973dda-c79e-4d95-935b-e4b93eb077b8@linux.ibm.com/
The lazy bits are only in tip.
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
> ---
> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
> index af62ec974b97..8f4acc55407b 100644
> --- a/arch/powerpc/kernel/interrupt.c
> +++ b/arch/powerpc/kernel/interrupt.c
> @@ -396,7 +396,7 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
> /* Returning to a kernel context with local irqs enabled. */
> WARN_ON_ONCE(!(regs->msr & MSR_EE));
> again:
> - if (IS_ENABLED(CONFIG_PREEMPT)) {
> + if (IS_ENABLED(CONFIG_PREEMPTION)) {
> /* Return to preemptible kernel context */
> if (unlikely(read_thread_flags() & _TIF_NEED_RESCHED)) {
> if (preempt_count() == 0)
Shouldn't exit_vmx_usercopy() get also this
s@CONFIG_PREEMPT@CONFIG_PREEMPTION@ change ?
Sebastian
next prev parent reply other threads:[~2024-11-08 10:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 10:18 [PATCH] powerpc: Add preempt lazy support Shrikanth Hegde
2024-11-08 10:50 ` Sebastian Andrzej Siewior [this message]
2024-11-09 16:52 ` Shrikanth Hegde
2024-11-14 2:01 ` Michael Ellerman
2024-11-15 7:04 ` Shrikanth Hegde
2024-11-08 19:06 ` Ankur Arora
2024-11-09 16:54 ` Shrikanth Hegde
2024-11-15 7:19 ` Shrikanth Hegde
2024-11-15 21:32 ` Ankur Arora
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=20241108105031.Uq8MV60I@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=ankur.a.arora@oracle.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=peterz@infradead.org \
--cc=sshegde@linux.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).