OSDN Git Service

rcu: Replace this_cpu_ptr() with __this_cpu_read()
authorPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 5 Nov 2018 22:20:57 +0000 (14:20 -0800)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 12 Nov 2018 17:03:59 +0000 (09:03 -0800)
Because __this_cpu_read() can be lighter weight than equivalent uses of
this_cpu_ptr(), this commit replaces the latter with the former.

Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
kernel/rcu/tree_plugin.h

index 618956c..0bb1c15 100644 (file)
@@ -597,7 +597,7 @@ rcu_preempt_deferred_qs_irqrestore(struct task_struct *t, unsigned long flags)
  */
 static bool rcu_preempt_need_deferred_qs(struct task_struct *t)
 {
-       return (this_cpu_ptr(&rcu_data)->deferred_qs ||
+       return (__this_cpu_read(rcu_data.deferred_qs) ||
                READ_ONCE(t->rcu_read_unlock_special.s)) &&
               t->rcu_read_lock_nesting <= 0;
 }