diff options
Diffstat (limited to 'kernel/rcuclassic.c')
-rw-r--r-- | kernel/rcuclassic.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c index f4ffbd0f306f..65c0906080ef 100644 --- a/kernel/rcuclassic.c +++ b/kernel/rcuclassic.c | |||
@@ -89,8 +89,22 @@ static void force_quiescent_state(struct rcu_data *rdp, | |||
89 | /* | 89 | /* |
90 | * Don't send IPI to itself. With irqs disabled, | 90 | * Don't send IPI to itself. With irqs disabled, |
91 | * rdp->cpu is the current cpu. | 91 | * rdp->cpu is the current cpu. |
92 | * | ||
93 | * cpu_online_map is updated by the _cpu_down() | ||
94 | * using stop_machine_run(). Since we're in irqs disabled | ||
95 | * section, stop_machine_run() is not exectuting, hence | ||
96 | * the cpu_online_map is stable. | ||
97 | * | ||
98 | * However, a cpu might have been offlined _just_ before | ||
99 | * we disabled irqs while entering here. | ||
100 | * And rcu subsystem might not yet have handled the CPU_DEAD | ||
101 | * notification, leading to the offlined cpu's bit | ||
102 | * being set in the rcp->cpumask. | ||
103 | * | ||
104 | * Hence cpumask = (rcp->cpumask & cpu_online_map) to prevent | ||
105 | * sending smp_reschedule() to an offlined CPU. | ||
92 | */ | 106 | */ |
93 | cpumask = rcp->cpumask; | 107 | cpus_and(cpumask, rcp->cpumask, cpu_online_map); |
94 | cpu_clear(rdp->cpu, cpumask); | 108 | cpu_clear(rdp->cpu, cpumask); |
95 | for_each_cpu_mask(cpu, cpumask) | 109 | for_each_cpu_mask(cpu, cpumask) |
96 | smp_send_reschedule(cpu); | 110 | smp_send_reschedule(cpu); |
@@ -529,7 +543,7 @@ static void __cpuinit rcu_online_cpu(int cpu) | |||
529 | 543 | ||
530 | rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp); | 544 | rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp); |
531 | rcu_init_percpu_data(cpu, &rcu_bh_ctrlblk, bh_rdp); | 545 | rcu_init_percpu_data(cpu, &rcu_bh_ctrlblk, bh_rdp); |
532 | open_softirq(RCU_SOFTIRQ, rcu_process_callbacks, NULL); | 546 | open_softirq(RCU_SOFTIRQ, rcu_process_callbacks); |
533 | } | 547 | } |
534 | 548 | ||
535 | static int __cpuinit rcu_cpu_notify(struct notifier_block *self, | 549 | static int __cpuinit rcu_cpu_notify(struct notifier_block *self, |