rcu: Switch to this_cpu() primitives
authorPaul E. McKenney <paul.mckenney@linaro.org>
Wed, 23 Feb 2011 19:10:52 +0000 (11:10 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 6 May 2011 06:16:57 +0000 (23:16 -0700)
This removes a couple of lines from invoke_rcu_cpu_kthread(), improving
readability.

Reported-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
kernel/rcutree.c

index 575d6414763e1214a0f4aa45711c034b87e03c10..27304bc15eca835f9efd93171b4f4f11fb1fc3b9 100644 (file)
@@ -1480,18 +1480,14 @@ static void rcu_process_callbacks(void)
 static void invoke_rcu_cpu_kthread(void)
 {
        unsigned long flags;
-       wait_queue_head_t *q;
-       int cpu;
 
        local_irq_save(flags);
-       cpu = smp_processor_id();
-       per_cpu(rcu_cpu_has_work, cpu) = 1;
-       if (per_cpu(rcu_cpu_kthread_task, cpu) == NULL) {
+       __this_cpu_write(rcu_cpu_has_work, 1);
+       if (__this_cpu_read(rcu_cpu_kthread_task) == NULL) {
                local_irq_restore(flags);
                return;
        }
-       q = &per_cpu(rcu_cpu_wq, cpu);
-       wake_up(q);
+       wake_up(&__get_cpu_var(rcu_cpu_wq));
        local_irq_restore(flags);
 }