[6/6] sched: cpufreq: Optimize cpufreq_update_this_cpu() a bit

Message ID d04b6fac0c94bc460cd070bea0e999a24a52b583.1495603536.git.viresh.kumar@linaro.org
State New
Headers show
Series
  • sched: Minor fixes and cleanups
Related show

Commit Message

Viresh Kumar May 24, 2017, 5:29 a.m.
smp_processor_id() can result in a function call if CONFIG_DEBUG_PREEMPT
is enabled. It would be much straight forward to use this_rq() macro
instead.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

---
 kernel/sched/sched.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.13.0.70.g6367777092d9

Patch hide | download patch | download mbox

diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index bcdf6a136c59..4220ec76d643 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1995,7 +1995,7 @@  static inline void cpufreq_update_util(struct rq *rq, unsigned int flags)
 
 static inline void cpufreq_update_this_cpu(struct rq *rq, unsigned int flags)
 {
-	if (cpu_of(rq) == smp_processor_id())
+	if (rq == this_rq())
 		cpufreq_update_util(rq, flags);
 }
 #else