workqueue: increase max_active of keventd and kill current_is_keventd()
[deliverable/linux.git] / arch / x86 / kernel / smpboot.c
index 763d815e27a005159ca5b52c68df4f43010b9832..4d90f376e985fef9f4b0a6b7dac19c60d1e02125 100644 (file)
@@ -686,7 +686,7 @@ static void __cpuinit do_fork_idle(struct work_struct *work)
 static void __cpuinit announce_cpu(int cpu, int apicid)
 {
        static int current_node = -1;
-       int node = cpu_to_node(cpu);
+       int node = early_cpu_to_node(cpu);
 
        if (system_state == SYSTEM_BOOTING) {
                if (node != current_node) {
@@ -735,7 +735,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu)
                goto do_rest;
        }
 
-       if (!keventd_up() || current_is_keventd())
+       if (!keventd_up())
                c_idle.work.func(&c_idle.work);
        else {
                schedule_work(&c_idle.work);
@@ -1215,9 +1215,17 @@ __init void prefill_possible_map(void)
        if (!num_processors)
                num_processors = 1;
 
-       if (setup_possible_cpus == -1)
-               possible = num_processors + disabled_cpus;
-       else
+       i = setup_max_cpus ?: 1;
+       if (setup_possible_cpus == -1) {
+               possible = num_processors;
+#ifdef CONFIG_HOTPLUG_CPU
+               if (setup_max_cpus)
+                       possible += disabled_cpus;
+#else
+               if (possible > i)
+                       possible = i;
+#endif
+       } else
                possible = setup_possible_cpus;
 
        total_cpus = max_t(int, possible, num_processors + disabled_cpus);
@@ -1230,11 +1238,23 @@ __init void prefill_possible_map(void)
                possible = nr_cpu_ids;
        }
 
+#ifdef CONFIG_HOTPLUG_CPU
+       if (!setup_max_cpus)
+#endif
+       if (possible > i) {
+               printk(KERN_WARNING
+                       "%d Processors exceeds max_cpus limit of %u\n",
+                       possible, setup_max_cpus);
+               possible = i;
+       }
+
        printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
                possible, max_t(int, possible - num_processors, 0));
 
        for (i = 0; i < possible; i++)
                set_cpu_possible(i, true);
+       for (; i < NR_CPUS; i++)
+               set_cpu_possible(i, false);
 
        nr_cpu_ids = possible;
 }
This page took 0.027115 seconds and 5 git commands to generate.