git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fake 64 bit version uml
[linux-2.6.git]
/
kernel
/
cpu.c
diff --git
a/kernel/cpu.c
b/kernel/cpu.c
index
fe2b8d0
..
e882c6b
100644
(file)
--- a/
kernel/cpu.c
+++ b/
kernel/cpu.c
@@
-18,7
+18,7
@@
/* This protects CPUs going up and down... */
static DECLARE_MUTEX(cpucontrol);
/* This protects CPUs going up and down... */
static DECLARE_MUTEX(cpucontrol);
-static
BLOCKING_NOTIFIER_HEAD(cpu_chain)
;
+static
struct notifier_block *cpu_chain
;
#ifdef CONFIG_HOTPLUG_CPU
static struct task_struct *lock_cpu_hotplug_owner;
#ifdef CONFIG_HOTPLUG_CPU
static struct task_struct *lock_cpu_hotplug_owner;
@@
-71,13
+71,21
@@
EXPORT_SYMBOL_GPL(lock_cpu_hotplug_interruptible);
/* Need to know about CPUs going up/down? */
int register_cpu_notifier(struct notifier_block *nb)
{
/* Need to know about CPUs going up/down? */
int register_cpu_notifier(struct notifier_block *nb)
{
- return blocking_notifier_chain_register(&cpu_chain, nb);
+ int ret;
+
+ if ((ret = lock_cpu_hotplug_interruptible()) != 0)
+ return ret;
+ ret = notifier_chain_register(&cpu_chain, nb);
+ unlock_cpu_hotplug();
+ return ret;
}
EXPORT_SYMBOL(register_cpu_notifier);
void unregister_cpu_notifier(struct notifier_block *nb)
{
}
EXPORT_SYMBOL(register_cpu_notifier);
void unregister_cpu_notifier(struct notifier_block *nb)
{
- blocking_notifier_chain_unregister(&cpu_chain, nb);
+ lock_cpu_hotplug();
+ notifier_chain_unregister(&cpu_chain, nb);
+ unlock_cpu_hotplug();
}
EXPORT_SYMBOL(unregister_cpu_notifier);
}
EXPORT_SYMBOL(unregister_cpu_notifier);
@@
-133,7
+141,7
@@
int cpu_down(unsigned int cpu)
goto out;
}
goto out;
}
- err =
blocking_
notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE,
+ err = notifier_call_chain(&cpu_chain, CPU_DOWN_PREPARE,
(void *)(long)cpu);
if (err == NOTIFY_BAD) {
printk("%s: attempt to take down CPU %u failed\n",
(void *)(long)cpu);
if (err == NOTIFY_BAD) {
printk("%s: attempt to take down CPU %u failed\n",
@@
-151,7
+159,7
@@
int cpu_down(unsigned int cpu)
p = __stop_machine_run(take_cpu_down, NULL, cpu);
if (IS_ERR(p)) {
/* CPU didn't die: tell everyone. Can't complain. */
p = __stop_machine_run(take_cpu_down, NULL, cpu);
if (IS_ERR(p)) {
/* CPU didn't die: tell everyone. Can't complain. */
- if (
blocking_
notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
+ if (notifier_call_chain(&cpu_chain, CPU_DOWN_FAILED,
(void *)(long)cpu) == NOTIFY_BAD)
BUG();
(void *)(long)cpu) == NOTIFY_BAD)
BUG();
@@
-174,8
+182,8
@@
int cpu_down(unsigned int cpu)
put_cpu();
/* CPU is completely dead: tell everyone. Too late to complain. */
put_cpu();
/* CPU is completely dead: tell everyone. Too late to complain. */
- if (
blocking_notifier_call_chain(&cpu_chain, CPU_DEAD,
-
(void *)(long)cpu)
== NOTIFY_BAD)
+ if (
notifier_call_chain(&cpu_chain, CPU_DEAD, (void *)(long)cpu)
+ == NOTIFY_BAD)
BUG();
check_for_tasks(cpu);
BUG();
check_for_tasks(cpu);
@@
-203,7
+211,7
@@
int __devinit cpu_up(unsigned int cpu)
goto out;
}
goto out;
}
- ret =
blocking_
notifier_call_chain(&cpu_chain, CPU_UP_PREPARE, hcpu);
+ ret = notifier_call_chain(&cpu_chain, CPU_UP_PREPARE, hcpu);
if (ret == NOTIFY_BAD) {
printk("%s: attempt to bring up CPU %u failed\n",
__FUNCTION__, cpu);
if (ret == NOTIFY_BAD) {
printk("%s: attempt to bring up CPU %u failed\n",
__FUNCTION__, cpu);
@@
-215,15
+223,15
@@
int __devinit cpu_up(unsigned int cpu)
ret = __cpu_up(cpu);
if (ret != 0)
goto out_notify;
ret = __cpu_up(cpu);
if (ret != 0)
goto out_notify;
- BUG_ON(!cpu_online(cpu));
+ if (!cpu_online(cpu))
+ BUG();
/* Now call notifier in preparation. */
/* Now call notifier in preparation. */
-
blocking_
notifier_call_chain(&cpu_chain, CPU_ONLINE, hcpu);
+ notifier_call_chain(&cpu_chain, CPU_ONLINE, hcpu);
out_notify:
if (ret != 0)
out_notify:
if (ret != 0)
- blocking_notifier_call_chain(&cpu_chain,
- CPU_UP_CANCELED, hcpu);
+ notifier_call_chain(&cpu_chain, CPU_UP_CANCELED, hcpu);
out:
unlock_cpu_hotplug();
return ret;
out:
unlock_cpu_hotplug();
return ret;