rcu: Remove "cpu" argument to rcu_preempt_check_callbacks()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 21 Oct 2014 15:12:00 +0000 (08:12 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 4 Nov 2014 03:20:26 +0000 (19:20 -0800)
Because rcu_preempt_check_callbacks()'s argument is guaranteed to
always be the current CPU, drop the argument and replace per_cpu()
with __this_cpu_read().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Pranith Kumar <bobby.prani@gmail.com>
kernel/rcu/tree.c
kernel/rcu/tree.h
kernel/rcu/tree_plugin.h

index 0670ba3a65d312feb750ff35890d49b1a6f17c74..1af5e2cdcbeb00ec473ea7d8650a76a954275820 100644 (file)
@@ -2420,7 +2420,7 @@ void rcu_check_callbacks(int user)
 
                rcu_bh_qs();
        }
-       rcu_preempt_check_callbacks(smp_processor_id());
+       rcu_preempt_check_callbacks();
        if (rcu_pending())
                invoke_rcu_core();
        if (user)
index 8e90562010ecfcc7f886af6f973c61abf334df98..94a26e330c1b6f42f20a4d2c209c00b34ac9e154 100644 (file)
@@ -561,7 +561,7 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
                                     struct rcu_node *rnp,
                                     struct rcu_data *rdp);
 #endif /* #ifdef CONFIG_HOTPLUG_CPU */
-static void rcu_preempt_check_callbacks(int cpu);
+static void rcu_preempt_check_callbacks(void);
 void call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu));
 #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_TREE_PREEMPT_RCU)
 static void rcu_report_exp_rnp(struct rcu_state *rsp, struct rcu_node *rnp,
index 09547143628ad80514cbcf19e89891d0c4012e8b..7158814b7b4a2a4528076c1cdf2fdadfada0367d 100644 (file)
@@ -621,7 +621,7 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
  *
  * Caller must disable hard irqs.
  */
-static void rcu_preempt_check_callbacks(int cpu)
+static void rcu_preempt_check_callbacks(void)
 {
        struct task_struct *t = current;
 
@@ -630,8 +630,8 @@ static void rcu_preempt_check_callbacks(int cpu)
                return;
        }
        if (t->rcu_read_lock_nesting > 0 &&
-           per_cpu(rcu_preempt_data, cpu).qs_pending &&
-           !per_cpu(rcu_preempt_data, cpu).passed_quiesce)
+           __this_cpu_read(rcu_preempt_data.qs_pending) &&
+           !__this_cpu_read(rcu_preempt_data.passed_quiesce))
                t->rcu_read_unlock_special.b.need_qs = true;
 }
 
@@ -1017,7 +1017,7 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
  * Because preemptible RCU does not exist, it never has any callbacks
  * to check.
  */
-static void rcu_preempt_check_callbacks(int cpu)
+static void rcu_preempt_check_callbacks(void)
 {
 }