From: Michael Ellerman <mpe@ellerman.id.au>
To: linuxppc-dev@ozlabs.org
Cc: juri.lelli@redhat.com, parth@linux.ibm.com, pauld@redhat.com,
srikar@linux.vnet.ibm.com, ego@linux.vnet.ibm.com,
Ihor.Pasichnyk@ibm.com, longman@redhat.com
Subject: [PATCH v5 2/2] powerpc/shared: Use static key to detect shared processor
Date: Fri, 13 Dec 2019 14:50:36 +1100 [thread overview]
Message-ID: <20191213035036.6913-2-mpe@ellerman.id.au> (raw)
In-Reply-To: <20191213035036.6913-1-mpe@ellerman.id.au>
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
With the static key shared processor available, is_shared_processor()
can return without having to query the lppaca structure.
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: Phil Auld <pauld@redhat.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191205083218.25824-2-srikar@linux.vnet.ibm.com
---
arch/powerpc/include/asm/spinlock.h | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
v5: No change.
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index cac95a3f30c2..1b55fc08f853 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -112,13 +112,8 @@ static inline void splpar_rw_yield(arch_rwlock_t *lock) {};
static inline bool is_shared_processor(void)
{
-/*
- * LPPACA is only available on Pseries so guard anything LPPACA related to
- * allow other platforms (which include this common header) to compile.
- */
-#ifdef CONFIG_PPC_PSERIES
- return (IS_ENABLED(CONFIG_PPC_SPLPAR) &&
- lppaca_shared_proc(local_paca->lppaca_ptr));
+#ifdef CONFIG_PPC_SPLPAR
+ return static_branch_unlikely(&shared_processor);
#else
return false;
#endif
--
2.21.0
next prev parent reply other threads:[~2019-12-13 3:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 3:50 [PATCH v5 1/2] powerpc/vcpu: Assume dedicated processors as non-preempt Michael Ellerman
2019-12-13 3:50 ` Michael Ellerman [this message]
2019-12-13 5:07 ` Srikar Dronamraju
2019-12-13 10:06 ` Michael Ellerman
2019-12-13 21:19 ` Michael Ellerman
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=20191213035036.6913-2-mpe@ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=Ihor.Pasichnyk@ibm.com \
--cc=ego@linux.vnet.ibm.com \
--cc=juri.lelli@redhat.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=longman@redhat.com \
--cc=parth@linux.ibm.com \
--cc=pauld@redhat.com \
--cc=srikar@linux.vnet.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).