linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Neuling <mikey@neuling.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Alexander Graf <agraf@suse.de>
Cc: Michael Neuling <mikey@neuling.org>,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: [PATCH v2 4/6] powerpc: Check cpu_thread_in_subcore() in __cpu_up()
Date: Fri, 23 May 2014 18:15:28 +1000	[thread overview]
Message-ID: <1400832930-17050-5-git-send-email-mikey@neuling.org> (raw)
In-Reply-To: <1400832930-17050-1-git-send-email-mikey@neuling.org>

From: Michael Ellerman <mpe@ellerman.id.au>

To support split core we need to change the check in __cpu_up() that
determines if a cpu is allowed to come online.

Currently we refuse to online cpus which are not the primary thread
within their core.

On POWER8 with split core support this check needs to instead refuse to
online cpus which are not the primary thread within their *sub* core.

On POWER7 and other systems that do not support split core,
threads_per_subcore == threads_per_core and so the check is equivalent.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 arch/powerpc/kernel/smp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 6edae3d..b5222c4 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -489,7 +489,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
 	 * Don't allow secondary threads to come online if inhibited
 	 */
 	if (threads_per_core > 1 && secondaries_inhibited() &&
-	    cpu % threads_per_core != 0)
+	    cpu_thread_in_subcore(cpu))
 		return -EBUSY;
 
 	if (smp_ops == NULL ||
-- 
1.9.1

  parent reply	other threads:[~2014-05-23  8:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  8:15 [PATCH v2 0/6] Implement split core for POWER8 Michael Neuling
2014-05-23  8:15 ` [PATCH v2 1/6] KVM: PPC: Book3S HV: Rework the secondary inhibit code Michael Neuling
2014-05-23  8:15 ` [PATCH v2 2/6] powerpc/powernv: Make it possible to skip the IRQHAPPENED check in power7_nap() Michael Neuling
2014-05-23  8:15 ` [PATCH v2 3/6] powerpc: Add threads_per_subcore Michael Neuling
2014-05-23  8:15 ` Michael Neuling [this message]
2014-05-23  8:15 ` [PATCH v2 5/6] KVM: PPC: Book3S HV: Use threads_per_subcore in KVM Michael Neuling
2014-05-23  8:15 ` [PATCH v2 6/6] powerpc/powernv: Add support for POWER8 split core on powernv Michael Neuling
2014-05-23  9:53 ` [PATCH v2 0/6] Implement split core for POWER8 Alexander Graf
2014-05-23 10:00   ` Michael Neuling
2014-05-23 10:05     ` Alexander Graf
2014-05-23 10:11       ` Michael Neuling
2014-05-23 10:27         ` Alexander Graf
2014-05-23 10:50           ` Michael Neuling

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=1400832930-17050-5-git-send-email-mikey@neuling.org \
    --to=mikey@neuling.org \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).