aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorDaniel Lezcano <[email protected]>2016-04-11 16:38:33 +0200
committerIngo Molnar <[email protected]>2016-04-13 12:25:22 +0200
commitc78b17e28cc2c2df74264afc408bdc6aaf3fbcc8 (patch)
tree71b034c2fa804cd624aad989569f47fadc137a77 /kernel
parentfb90a6e93c0684ab2629a42462400603aa829b9c (diff)
sched/clock: Remove pointless test in cpu_clock/local_clock
In case the HAVE_UNSTABLE_SCHED_CLOCK config is set, the cpu_clock() version checks if sched_clock_stable() is not set and calls sched_clock_cpu(), otherwise it calls sched_clock(). sched_clock_cpu() checks also if sched_clock_stable() is set and, if true, calls sched_clock(). sched_clock() will be called in sched_clock_cpu() if sched_clock_stable() is true. Remove the duplicate test by directly calling sched_clock_cpu() and let the static key act in this function instead. Signed-off-by: Daniel Lezcano <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/clock.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index fedb967a9841..30c4b202f0ba 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -375,10 +375,7 @@ EXPORT_SYMBOL_GPL(sched_clock_idle_wakeup_event);
*/
u64 cpu_clock(int cpu)
{
- if (!sched_clock_stable())
- return sched_clock_cpu(cpu);
-
- return sched_clock();
+ return sched_clock_cpu(cpu);
}
/*
@@ -390,10 +387,7 @@ u64 cpu_clock(int cpu)
*/
u64 local_clock(void)
{
- if (!sched_clock_stable())
- return sched_clock_cpu(raw_smp_processor_id());
-
- return sched_clock();
+ return sched_clock_cpu(raw_smp_processor_id());
}
#else /* CONFIG_HAVE_UNSTABLE_SCHED_CLOCK */