Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /kernel/cpu.c

Filename:/kernel/cpu.c
Lines Added:13
Lines Deleted:1
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4  2.6.24-rc3 
(Following) 2.6.24-git2  2.6.24-git3  2.6.24-git4  2.6.24-git5  2.6.24-git6  2.6.24-git7 

Location
[  2.6.24
  [  kernel
     o  cpu.c

Patch

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 38033db..6b3a0c1 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -98,7 +98,8 @@ static inline void check_for_tasks(int cpu)
            !cputime_eq(p->stime, cputime_zero)))
          printk(KERN_WARNING "Task %s (pid = %d) is on cpu %d\
             (state = %ld, flags = %x) \n",
-             p->comm, p->pid, cpu, p->state, p->flags);
+             p->comm, task_pid_nr(p), cpu,
+             p->state, p->flags);
    }
    write_unlock_irq(&tasklist_lock);
 }
@@ -150,6 +151,7 @@ static int _cpu_down(unsigned int cpu, int tasks_frozen)
    err = __raw_notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE | mod,
                hcpu, -1, &nr_calls);
    if (err == NOTIFY_BAD) {
+      nr_calls--;
       __raw_notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED | mod,
                  hcpu, nr_calls, NULL);
       printk("%s: attempt to take down CPU %u failed\n",
@@ -233,6 +235,7 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
    ret = __raw_notifier_call_chain(&cpu_chain, CPU_UP_PREPARE | mod, hcpu,
                      -1, &nr_calls);
    if (ret == NOTIFY_BAD) {
+      nr_calls--;
       printk("%s: attempt to bring up CPU %u failed\n",
             __FUNCTION__, cpu);
       ret = -EINVAL;
@@ -262,6 +265,15 @@ out_notify:
 int __cpuinit cpu_up(unsigned int cpu)
 {
    int err = 0;
+   if (!cpu_isset(cpu, cpu_possible_map)) {
+      printk(KERN_ERR "can't online cpu %d because it is not "
+         "configured as may-hotadd at boot time\n", cpu);
+#if defined(CONFIG_IA64) || defined(CONFIG_X86_64) || defined(CONFIG_S390)
+      printk(KERN_ERR "please check additional_cpus= boot "
+            "parameter\n");
+#endif
+      return -EINVAL;
+   }
 
    mutex_lock(&cpu_add_remove_lock);
    if (cpu_hotplug_disabled)


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.