Commit ed11a7f1 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Ingo Molnar

context_tracking: Switch to new static_branch API

This is much less error-prone than the old code.
Signed-off-by: default avatarAndy Lutomirski <>
Cc: Andy Lutomirski <>
Cc: Borislav Petkov <>
Cc: Brian Gerst <>
Cc: Denys Vlasenko <>
Cc: Frederic Weisbecker <>
Cc: H. Peter Anvin <>
Cc: Linus Torvalds <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Link: default avatarIngo Molnar <>
parent 49b24106
......@@ -22,12 +22,12 @@ struct context_tracking {
extern struct static_key context_tracking_enabled;
extern struct static_key_false context_tracking_enabled;
DECLARE_PER_CPU(struct context_tracking, context_tracking);
static inline bool context_tracking_is_enabled(void)
return static_key_false(&context_tracking_enabled);
return static_branch_unlikely(&context_tracking_enabled);
static inline bool context_tracking_cpu_is_enabled(void)
......@@ -24,7 +24,7 @@
#include <trace/events/context_tracking.h>
struct static_key context_tracking_enabled = STATIC_KEY_INIT_FALSE;
DEFINE_PER_CPU(struct context_tracking, context_tracking);
......@@ -191,7 +191,7 @@ void __init context_tracking_cpu_set(int cpu)
if (!per_cpu(, cpu)) {
per_cpu(, cpu) = true;
if (initialized)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment