From: Segher Boessenkool <segher@kernel.crashing.org>
To: Nicholas Piggin <npiggin@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v3 2/2] powerpc/64s: Make POWER10 and later use pause_short in cpu_relax loops
Date: Wed, 20 Jul 2022 16:02:41 -0500 [thread overview]
Message-ID: <20220720210241.GG25951@gate.crashing.org> (raw)
In-Reply-To: <20220720132132.903462-2-npiggin@gmail.com>
Hi!
On Wed, Jul 20, 2022 at 11:21:32PM +1000, Nicholas Piggin wrote:
> We want to move away from using SMT prioroty updates for cpu_relax, and
(typo, "priority")
> +#define spin_begin() \
> +do { \
> + asm volatile(ASM_FTR_IFCLR( \
> + "or 1,1,1", /* HMT_LOW */ \
> + "nop",/* POWER10 onward uses pause_short (wait 2,0) */ \
> + %0) :: "i" (CPU_FTR_ARCH_31) : "memory"); \
> +} while (0)
Is that nop patched later? Or should you change the comment, maybe?
> +#define spin_cpu_relax() \
> +do { \
> + asm volatile(ASM_FTR_IFCLR( \
> + /* Pre-POWER10 uses low / medium priority nops */ \
> + "nop", \
"nop" aka "or 0,0,0" does not change program priority? Medium low would
be "or 6,6,6", not sure if that is the ppr you wanted here?
> + /* POWER10 onward uses pause_short (wait 2,0) */ \
> + PPC_WAIT(2, 0), \
> + %0) :: "i" (CPU_FTR_ARCH_31) : "memory"); \
> +} while (0)
> +
> +#define spin_end() \
> +do { \
> + asm volatile(ASM_FTR_IFCLR( \
> + "or 2,2,2", /* HMT_MEDIUM */ \
> + "nop",/* POWER10 onward uses pause_short (wait 2,0) */ \
> + %0) :: "i" (CPU_FTR_ARCH_31) : "memory"); \
> +} while (0)
Same comment as for spin_begin.
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Segher
next prev parent reply other threads:[~2022-07-20 21:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-20 13:21 [PATCH v3 1/2] powerpc: add ISA v3.0 / v3.1 wait opcode macro Nicholas Piggin
2022-07-20 13:21 ` [PATCH v3 2/2] powerpc/64s: Make POWER10 and later use pause_short in cpu_relax loops Nicholas Piggin
2022-07-20 21:02 ` Segher Boessenkool [this message]
2022-07-26 12:52 ` Michael Ellerman
2022-07-20 21:07 ` [PATCH v3 1/2] powerpc: add ISA v3.0 / v3.1 wait opcode macro Segher Boessenkool
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=20220720210241.GG25951@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.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).