]> Git Repo - linux.git/commitdiff
cpu/hotplug: Move bringup of secondary CPUs out of smp_init()
authorQais Yousef <[email protected]>
Mon, 23 Mar 2020 13:51:09 +0000 (13:51 +0000)
committerThomas Gleixner <[email protected]>
Wed, 25 Mar 2020 11:59:37 +0000 (12:59 +0100)
This is the last direct user of cpu_up() before it can become an internal
implementation detail of the cpu subsystem.

Signed-off-by: Qais Yousef <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
include/linux/cpu.h
kernel/cpu.c
kernel/smp.c

index 9dc1e892e193dc05f43beedff8f5543f6203c675..8b295f78da2545c93f4804c9c21a5c94f904c9c5 100644 (file)
@@ -94,6 +94,7 @@ void notify_cpu_starting(unsigned int cpu);
 extern void cpu_maps_update_begin(void);
 extern void cpu_maps_update_done(void);
 int bringup_hibernate_cpu(unsigned int sleep_cpu);
+void bringup_nonboot_cpus(unsigned int setup_max_cpus);
 
 #else  /* CONFIG_SMP */
 #define cpuhp_tasks_frozen     0
index f803678684e9be0cab48febd5b26cf00fbe453ba..4783d811ccf8a4c975cc57a644adfb3879d706c4 100644 (file)
@@ -1298,6 +1298,18 @@ int bringup_hibernate_cpu(unsigned int sleep_cpu)
        return 0;
 }
 
+void bringup_nonboot_cpus(unsigned int setup_max_cpus)
+{
+       unsigned int cpu;
+
+       for_each_present_cpu(cpu) {
+               if (num_online_cpus() >= setup_max_cpus)
+                       break;
+               if (!cpu_online(cpu))
+                       cpu_up(cpu);
+       }
+}
+
 #ifdef CONFIG_PM_SLEEP_SMP
 static cpumask_var_t frozen_cpus;
 
index 97f1d9765c94602d3d954205d98599b92895c4f0..786092aabdcd6a997f1bbf428aba111421110bea 100644 (file)
@@ -597,20 +597,13 @@ void __init setup_nr_cpu_ids(void)
 void __init smp_init(void)
 {
        int num_nodes, num_cpus;
-       unsigned int cpu;
 
        idle_threads_init();
        cpuhp_threads_init();
 
        pr_info("Bringing up secondary CPUs ...\n");
 
-       /* FIXME: This should be done in userspace --RR */
-       for_each_present_cpu(cpu) {
-               if (num_online_cpus() >= setup_max_cpus)
-                       break;
-               if (!cpu_online(cpu))
-                       cpu_up(cpu);
-       }
+       bringup_nonboot_cpus(setup_max_cpus);
 
        num_nodes = num_online_nodes();
        num_cpus  = num_online_cpus();
This page took 0.061026 seconds and 4 git commands to generate.