Skip to content

Commit 44dbcc9

Browse files
Suzuki K Poulosewildea01
authored andcommitted
arm64: Fix behavior of maxcpus=N
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> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 6a6efbb commit 44dbcc9

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

arch/arm64/kernel/smp.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -689,33 +689,18 @@ void __init smp_init_cpus(void)
689689
void __init smp_prepare_cpus(unsigned int max_cpus)
690690
{
691691
int err;
692-
unsigned int cpu, ncores = num_possible_cpus();
692+
unsigned int cpu;
693693

694694
init_cpu_topology();
695695

696696
smp_store_cpu_info(smp_processor_id());
697697

698-
/*
699-
* are we trying to boot more cores than exist?
700-
*/
701-
if (max_cpus > ncores)
702-
max_cpus = ncores;
703-
704-
/* Don't bother if we're effectively UP */
705-
if (max_cpus <= 1)
706-
return;
707-
708698
/*
709699
* Initialise the present map (which describes the set of CPUs
710700
* actually populated at the present time) and release the
711701
* secondaries from the bootloader.
712-
*
713-
* Make sure we online at most (max_cpus - 1) additional CPUs.
714702
*/
715-
max_cpus--;
716703
for_each_possible_cpu(cpu) {
717-
if (max_cpus == 0)
718-
break;
719704

720705
if (cpu == smp_processor_id())
721706
continue;
@@ -728,7 +713,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
728713
continue;
729714

730715
set_cpu_present(cpu, true);
731-
max_cpus--;
732716
}
733717
}
734718

0 commit comments

Comments
 (0)