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

From: Viresh Kumar
Date: Wed May 24 2017 - 01:31:36 EST


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@xxxxxxxxxx>
---
kernel/sched/sched.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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
--
2.13.0.70.g6367777092d9