diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-03-18 14:56:07 +0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-03-20 15:35:46 +0400 |
commit | 6201b4d61fbf194df6371fb3376c5026cb8f5eec (patch) | |
tree | fe26631f72f263256eecfe127346687b423b2e21 /include/linux/sched.h | |
parent | e2e680fb7566880f7210cadf628c092c0433971c (diff) | |
download | linux-6201b4d61fbf194df6371fb3376c5026cb8f5eec.tar.xz |
timer: Remove code redundancy while calling get_nohz_timer_target()
There are only two users of get_nohz_timer_target(): timer and hrtimer. Both
call it under same circumstances, i.e.
#ifdef CONFIG_NO_HZ_COMMON
if (!pinned && get_sysctl_timer_migration() && idle_cpu(this_cpu))
return get_nohz_timer_target();
#endif
So, it makes more sense to get all this as part of get_nohz_timer_target()
instead of duplicating code at two places. For this another parameter is
required to be passed to this routine, pinned.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Cc: fweisbec@gmail.com
Cc: peterz@infradead.org
Link: http://lkml.kernel.org/r/1e1b53537217d58d48c2d7a222a9c3ac47d5b64c.1395140107.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 68a0e84463a0..6f6c56f63c68 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -291,10 +291,14 @@ extern int runqueue_is_locked(int cpu); #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ_COMMON) extern void nohz_balance_enter_idle(int cpu); extern void set_cpu_sd_state_idle(void); -extern int get_nohz_timer_target(void); +extern int get_nohz_timer_target(int pinned); #else static inline void nohz_balance_enter_idle(int cpu) { } static inline void set_cpu_sd_state_idle(void) { } +static inline int get_nohz_timer_target(int pinned) +{ + return smp_processor_id(); +} #endif /* |