Skip to content

Commit d0df09e

Browse files
committed
context_tracking: Rename context_tracking_active() to context_tracking_cpu_is_enabled()
We currently have a confusing couple of API naming with the existing context_tracking_active() and context_tracking_is_enabled(). Lets keep the latter one, context_tracking_is_enabled(), for global context tracking state check and use context_tracking_cpu_is_enabled() for local state check. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org>
1 parent 58135f5 commit d0df09e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

include/linux/context_tracking_state.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ static inline bool context_tracking_is_enabled(void)
2626
{
2727
return static_key_false(&context_tracking_enabled);
2828
}
29-
static inline bool context_tracking_in_user(void)
29+
30+
static inline bool context_tracking_cpu_is_enabled(void)
3031
{
31-
return __this_cpu_read(context_tracking.state) == IN_USER;
32+
return __this_cpu_read(context_tracking.active);
3233
}
3334

34-
static inline bool context_tracking_active(void)
35+
static inline bool context_tracking_in_user(void)
3536
{
36-
return __this_cpu_read(context_tracking.active);
37+
return __this_cpu_read(context_tracking.state) == IN_USER;
3738
}
3839
#else
3940
static inline bool context_tracking_in_user(void) { return false; }

include/linux/vtime.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ static inline bool vtime_accounting_enabled(void) { return true; }
2020
static inline bool vtime_accounting_enabled(void)
2121
{
2222
if (context_tracking_is_enabled()) {
23-
if (context_tracking_active())
23+
if (context_tracking_cpu_is_enabled())
2424
return true;
2525
}
2626

0 commit comments

Comments
 (0)