diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2009-08-15 12:53:48 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-15 13:02:08 -0400 |
commit | 2e597558086dec36d5c33521a36e0f6b1bc3f3a7 (patch) | |
tree | ce8c6ced1c8a3b6bf6170a5894e1d7102e6ee9d4 /kernel/rcupreempt.c | |
parent | 799e64f05f4bfaad2bb3165cab95c8c992a1c296 (diff) |
rcu: Simplify RCU CPU-hotplug notification
Use the new cpu_notifier() API to simplify RCU's CPU-hotplug
notifiers, collapsing down to a single such notifier.
This makes it trivial to provide the notifier-ordering
guarantee that rcu_barrier() depends on.
Also remove redundant open_softirq() calls from Hierarchical
RCU notifier.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: laijs@cn.fujitsu.com
Cc: dipankar@in.ibm.com
Cc: josht@linux.vnet.ibm.com
Cc: akpm@linux-foundation.org
Cc: mathieu.desnoyers@polymtl.ca
Cc: dvhltc@us.ibm.com
Cc: niv@us.ibm.com
Cc: peterz@infradead.org
Cc: rostedt@goodmis.org
Cc: hugh.dickins@tiscali.co.uk
Cc: benh@kernel.crashing.org
LKML-Reference: <12503552312510-git-send-email->
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcupreempt.c')
-rw-r--r-- | kernel/rcupreempt.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/kernel/rcupreempt.c b/kernel/rcupreempt.c index beb0e659adcc..9b87f5134ed7 100644 --- a/kernel/rcupreempt.c +++ b/kernel/rcupreempt.c | |||
@@ -1417,8 +1417,8 @@ int rcu_pending(int cpu) | |||
1417 | return 0; | 1417 | return 0; |
1418 | } | 1418 | } |
1419 | 1419 | ||
1420 | static int __cpuinit rcu_cpu_notify(struct notifier_block *self, | 1420 | int __cpuinit rcu_cpu_notify(struct notifier_block *self, |
1421 | unsigned long action, void *hcpu) | 1421 | unsigned long action, void *hcpu) |
1422 | { | 1422 | { |
1423 | long cpu = (long)hcpu; | 1423 | long cpu = (long)hcpu; |
1424 | 1424 | ||
@@ -1439,10 +1439,6 @@ static int __cpuinit rcu_cpu_notify(struct notifier_block *self, | |||
1439 | return NOTIFY_OK; | 1439 | return NOTIFY_OK; |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | static struct notifier_block __cpuinitdata rcu_nb = { | ||
1443 | .notifier_call = rcu_cpu_notify, | ||
1444 | }; | ||
1445 | |||
1446 | void __init __rcu_init(void) | 1442 | void __init __rcu_init(void) |
1447 | { | 1443 | { |
1448 | int cpu; | 1444 | int cpu; |
@@ -1471,23 +1467,6 @@ void __init __rcu_init(void) | |||
1471 | rdp->waitschedtail = &rdp->waitschedlist; | 1467 | rdp->waitschedtail = &rdp->waitschedlist; |
1472 | rdp->rcu_sched_sleeping = 0; | 1468 | rdp->rcu_sched_sleeping = 0; |
1473 | } | 1469 | } |
1474 | register_cpu_notifier(&rcu_nb); | ||
1475 | |||
1476 | /* | ||
1477 | * We don't need protection against CPU-Hotplug here | ||
1478 | * since | ||
1479 | * a) If a CPU comes online while we are iterating over the | ||
1480 | * cpu_online_mask below, we would only end up making a | ||
1481 | * duplicate call to rcu_online_cpu() which sets the corresponding | ||
1482 | * CPU's mask in the rcu_cpu_online_map. | ||
1483 | * | ||
1484 | * b) A CPU cannot go offline at this point in time since the user | ||
1485 | * does not have access to the sysfs interface, nor do we | ||
1486 | * suspend the system. | ||
1487 | */ | ||
1488 | for_each_online_cpu(cpu) | ||
1489 | rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long) cpu); | ||
1490 | |||
1491 | open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); | 1470 | open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); |
1492 | } | 1471 | } |
1493 | 1472 | ||