[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <157234274070.29376.6106888898574236448.tip-bot2@tip-bot2>
Date: Tue, 29 Oct 2019 09:52:20 -0000
From: "tip-bot2 for Frederic Weisbecker" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Frederic Weisbecker <frederic@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Pavel Machek <pavel@....cz>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Rik van Riel <riel@...riel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Viresh Kumar <viresh.kumar@...aro.org>,
Wanpeng Li <wanpengli@...cent.com>,
Yauheni Kaliuta <yauheni.kaliuta@...hat.com>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
linux-kernel@...r.kernel.org
Subject: [tip: sched/core] context_tracking: Introduce context_tracking_enabled_cpu()
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 097f2541c6e51e0c1cdb1e6d46ef08a624336518
Gitweb: https://git.kernel.org/tip/097f2541c6e51e0c1cdb1e6d46ef08a624336518
Author: Frederic Weisbecker <frederic@...nel.org>
AuthorDate: Wed, 16 Oct 2019 04:56:53 +02:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Tue, 29 Oct 2019 10:01:13 +01:00
context_tracking: Introduce context_tracking_enabled_cpu()
This allows us to check if a remote CPU runs context tracking
(ie: is nohz_full). We'll need that to reliably support "nice"
accounting on kcpustat.
Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Jacek Anaszewski <jacek.anaszewski@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Pavel Machek <pavel@....cz>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Rafael J . Wysocki <rjw@...ysocki.net>
Cc: Rik van Riel <riel@...riel.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Wanpeng Li <wanpengli@...cent.com>
Cc: Yauheni Kaliuta <yauheni.kaliuta@...hat.com>
Link: https://lkml.kernel.org/r/20191016025700.31277-8-frederic@kernel.org
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
include/linux/context_tracking_state.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index 08f125f..5877177 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -31,6 +31,11 @@ static inline bool context_tracking_enabled(void)
return static_branch_unlikely(&context_tracking_key);
}
+static inline bool context_tracking_enabled_cpu(int cpu)
+{
+ return per_cpu(context_tracking.active, cpu);
+}
+
static inline bool context_tracking_enabled_this_cpu(void)
{
return __this_cpu_read(context_tracking.active);
@@ -43,6 +48,7 @@ static inline bool context_tracking_in_user(void)
#else
static inline bool context_tracking_in_user(void) { return false; }
static inline bool context_tracking_enabled(void) { return false; }
+static inline bool context_tracking_enabled_cpu(int cpu) { return false; }
static inline bool context_tracking_enabled_this_cpu(void) { return false; }
#endif /* CONFIG_CONTEXT_TRACKING */
Powered by blists - more mailing lists