summaryrefslogtreecommitdiff
path: root/kernel/sched/clock.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2016-12-15 13:21:58 +0100
committerIngo Molnar <mingo@kernel.org>2017-01-14 11:29:57 +0100
commit555570d744f8150d3fce6083f144026cd1e63627 (patch)
treee0db4da7dd7949d80a562ad621e08100194688fe /kernel/sched/clock.c
parent12907fbb1a691807bb0420a27126e15934cb7954 (diff)
sched/clock: Update static_key usage
sched_clock was still using the deprecated static_key interface. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/clock.c')
-rw-r--r--kernel/sched/clock.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index e85a725e5c34..5d6dd38b449c 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -78,19 +78,17 @@ EXPORT_SYMBOL_GPL(sched_clock);
__read_mostly int sched_clock_running;
#ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
-static struct static_key __sched_clock_stable = STATIC_KEY_INIT;
+static DEFINE_STATIC_KEY_FALSE(__sched_clock_stable);
static int __sched_clock_stable_early;
int sched_clock_stable(void)
{
- return static_key_false(&__sched_clock_stable);
+ return static_branch_likely(&__sched_clock_stable);
}
static void __set_sched_clock_stable(void)
{
- if (!sched_clock_stable())
- static_key_slow_inc(&__sched_clock_stable);
-
+ static_branch_enable(&__sched_clock_stable);
tick_dep_clear(TICK_DEP_BIT_CLOCK_UNSTABLE);
}
@@ -109,9 +107,7 @@ void set_sched_clock_stable(void)
static void __clear_sched_clock_stable(struct work_struct *work)
{
/* XXX worry about clock continuity */
- if (sched_clock_stable())
- static_key_slow_dec(&__sched_clock_stable);
-
+ static_branch_disable(&__sched_clock_stable);
tick_dep_set(TICK_DEP_BIT_CLOCK_UNSTABLE);
}