From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: mark.rutland@arm.com, marc.zyngier@arm.com,
linux-kernel@vger.kernel.org, will.deacon@arm.com,
catalin.marinas@arm.com, Vadim.Lomovtsev@caviumnetworks.com,
Suzuki K Poulose <suzuki.poulose@arm.com>,
James Morse <james.morse@arm.com>
Subject: [PATCH v5 5/5] arm64: Fix behavior of maxcpus=N
Date: Tue, 26 Apr 2016 15:49:00 +0100 [thread overview]
Message-ID: <1461682140-7131-6-git-send-email-suzuki.poulose@arm.com> (raw)
In-Reply-To: <1461682140-7131-1-git-send-email-suzuki.poulose@arm.com>
maxcpu=n sets the number of CPUs activated at boot time to a max of n,
but allowing the remaining CPUs to be brought up later if the user
decides to do so. However, on arm64 due to various reasons, we disallowed
hotplugging CPUs beyond n, by marking them not present. Now that
we have checks in place to make sure the hotplugged CPUs have compatible
features with system and requires no new errata, relax the restriction.
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: James Morse <james.morse@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
arch/arm64/kernel/smp.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index fef2e73..dc96475 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -689,33 +689,18 @@ void __init smp_init_cpus(void)
void __init smp_prepare_cpus(unsigned int max_cpus)
{
int err;
- unsigned int cpu, ncores = num_possible_cpus();
+ unsigned int cpu;
init_cpu_topology();
smp_store_cpu_info(smp_processor_id());
/*
- * are we trying to boot more cores than exist?
- */
- if (max_cpus > ncores)
- max_cpus = ncores;
-
- /* Don't bother if we're effectively UP */
- if (max_cpus <= 1)
- return;
-
- /*
* Initialise the present map (which describes the set of CPUs
* actually populated at the present time) and release the
* secondaries from the bootloader.
- *
- * Make sure we online at most (max_cpus - 1) additional CPUs.
*/
- max_cpus--;
for_each_possible_cpu(cpu) {
- if (max_cpus == 0)
- break;
if (cpu == smp_processor_id())
continue;
@@ -728,7 +713,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
continue;
set_cpu_present(cpu, true);
- max_cpus--;
}
}
--
1.7.9.5
next prev parent reply other threads:[~2016-04-26 14:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-26 14:48 [PATCH v5 0/5] arm64: Fix behavior of maxcpus=n Suzuki K Poulose
2016-04-26 14:48 ` [PATCH v5 1/5] arm64: cpufeature: Add scope for capability check Suzuki K Poulose
2016-04-26 14:48 ` [PATCH v5 2/5] arm64: Allow a capability to be checked on a single CPU Suzuki K Poulose
2016-04-26 14:48 ` [PATCH v5 3/5] irqchip/gic: Restore CPU interface checking Suzuki K Poulose
2016-04-26 14:48 ` [PATCH v5 4/5] arm64: Verify CPU errata work arounds on hotplugged CPU Suzuki K Poulose
2016-04-26 14:49 ` Suzuki K Poulose [this message]
2016-04-26 14:50 ` [PATCH v5 0/5] arm64: Fix behavior of maxcpus=n Will Deacon
2016-04-26 14:56 ` Suzuki K Poulose
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=1461682140-7131-6-git-send-email-suzuki.poulose@arm.com \
--to=suzuki.poulose@arm.com \
--cc=Vadim.Lomovtsev@caviumnetworks.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
--cc=mark.rutland@arm.com \
--cc=will.deacon@arm.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
all inboxes | Powered by JetHome®