From: Frederic Weisbecker <fweisbec@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Oleg Nesterov <oleg@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>
Subject: [PATCH 4/6] context_tracking: Rename context_tracking_active() to context_tracking_cpu_is_enabled()
Date: Thu, 7 Nov 2013 19:16:29 +0100 [thread overview]
Message-ID: <1383848191-30807-5-git-send-email-fweisbec@gmail.com> (raw)
In-Reply-To: <1383848191-30807-1-git-send-email-fweisbec@gmail.com>
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>
---
include/linux/context_tracking_state.h | 9 +++++----
include/linux/vtime.h | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index 0db535b..97a8122 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -26,14 +26,15 @@ static inline bool context_tracking_is_enabled(void)
{
return static_key_false(&context_tracking_enabled);
}
-static inline bool context_tracking_in_user(void)
+
+static inline bool context_tracking_cpu_is_enabled(void)
{
- return __this_cpu_read(context_tracking.state) == IN_USER;
+ return __this_cpu_read(context_tracking.active);
}
-static inline bool context_tracking_active(void)
+static inline bool context_tracking_in_user(void)
{
- return __this_cpu_read(context_tracking.active);
+ return __this_cpu_read(context_tracking.state) == IN_USER;
}
#else
static inline bool context_tracking_in_user(void) { return false; }
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index 807c732..c5165fd 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -20,7 +20,7 @@ static inline bool vtime_accounting_enabled(void) { return true; }
static inline bool vtime_accounting_enabled(void)
{
if (context_tracking_is_enabled()) {
- if (context_tracking_active())
+ if (context_tracking_cpu_is_enabled())
return true;
}
--
1.8.3.1
next prev parent reply other threads:[~2013-11-07 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 18:16 [PATCH 0/6] timers: updates for 3.13 preview Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 1/6] nohz: Convert a few places to use local per cpu accesses Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 2/6] trivial: fix spelling in CONTEXT_TRACKING_FORCE help text Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 3/6] context_tracking: Wrap static key check into more intuitive function name Frederic Weisbecker
2013-11-07 18:16 ` Frederic Weisbecker [this message]
2013-11-07 18:16 ` [PATCH 5/6] posix-timers: Spare workqueue if there is no full dynticks CPU to kick Frederic Weisbecker
2013-11-07 18:16 ` [PATCH 6/6] posix-timers: Fix full dynticks CPUs kick on timer rescheduling Frederic Weisbecker
2013-12-03 14:38 [GIT PULL v2] dynticks updates for 3.14 Frederic Weisbecker
2013-12-03 14:38 ` [PATCH 4/6] context_tracking: Rename context_tracking_active() to context_tracking_cpu_is_enabled() Frederic Weisbecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1383848191-30807-5-git-send-email-fweisbec@gmail.com \
--to=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®