From: riel@redhat.com
To: linux-kernel@vger.kernel.org
Cc: fweisbec@redhat.com, peterz@infradead.org, mingo@kernel.org,
tglx@linutronix.de, luto@amacapital.net
Subject: [RFC PATCH 02/11] time,nohz: rename vtime_accounting_enabled to tick_accounting_disabled
Date: Wed, 24 Jun 2015 10:57:51 -0400 [thread overview]
Message-ID: <1435157880-22925-3-git-send-email-riel@redhat.com> (raw)
In-Reply-To: <1435157880-22925-1-git-send-email-riel@redhat.com>
From: Rik van Riel <riel@redhat.com>
Rename vtime_accounting_enabled to tick_accounting_disabled, because it
can mean either that vtime accounting is enabled, or that the system
is doing tick based sampling from a housekeeping CPU for nohz_full CPUs.
Signed-off-by: Rik van Riel <riel@redhat.com>
---
include/linux/context_tracking.h | 4 ++--
include/linux/vtime.h | 17 ++++++++++-------
kernel/sched/cputime.c | 2 +-
kernel/time/tick-sched.c | 2 +-
4 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index dc3b169b2b70..d7ee7eb9e0bc 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -90,7 +90,7 @@ static inline void context_tracking_init(void) { }
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
static inline void guest_enter(void)
{
- if (vtime_accounting_enabled())
+ if (tick_accounting_disabled())
vtime_guest_enter(current);
else
current->flags |= PF_VCPU;
@@ -104,7 +104,7 @@ static inline void guest_exit(void)
if (context_tracking_is_enabled())
__context_tracking_exit(CONTEXT_GUEST);
- if (vtime_accounting_enabled())
+ if (tick_accounting_disabled())
vtime_guest_exit(current);
else
current->flags &= ~PF_VCPU;
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index c5165fd256f9..4f5c1a3712e7 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -10,14 +10,17 @@
struct task_struct;
/*
- * vtime_accounting_enabled() definitions/declarations
+ * tick_accounting_disabled() definitions/declarations
+ *
+ * This indicates that either vtime accounting is used, or that tick
+ * based sampling is done from a housekeeping CPU for nohz_full CPUs.
*/
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
-static inline bool vtime_accounting_enabled(void) { return true; }
+static inline bool tick_accounting_disabled(void) { return true; }
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
-static inline bool vtime_accounting_enabled(void)
+static inline bool tick_accounting_disabled(void)
{
if (context_tracking_is_enabled()) {
if (context_tracking_cpu_is_enabled())
@@ -29,7 +32,7 @@ static inline bool vtime_accounting_enabled(void)
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
#ifndef CONFIG_VIRT_CPU_ACCOUNTING
-static inline bool vtime_accounting_enabled(void) { return false; }
+static inline bool tick_accounting_disabled(void) { return false; }
#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
@@ -44,7 +47,7 @@ extern void vtime_task_switch(struct task_struct *prev);
extern void vtime_common_task_switch(struct task_struct *prev);
static inline void vtime_task_switch(struct task_struct *prev)
{
- if (vtime_accounting_enabled())
+ if (tick_accounting_disabled())
vtime_common_task_switch(prev);
}
#endif /* __ARCH_HAS_VTIME_TASK_SWITCH */
@@ -59,7 +62,7 @@ extern void vtime_account_irq_enter(struct task_struct *tsk);
extern void vtime_common_account_irq_enter(struct task_struct *tsk);
static inline void vtime_account_irq_enter(struct task_struct *tsk)
{
- if (vtime_accounting_enabled())
+ if (tick_accounting_disabled())
vtime_common_account_irq_enter(tsk);
}
#endif /* __ARCH_HAS_VTIME_ACCOUNT */
@@ -78,7 +81,7 @@ extern void vtime_gen_account_irq_exit(struct task_struct *tsk);
static inline void vtime_account_irq_exit(struct task_struct *tsk)
{
- if (vtime_accounting_enabled())
+ if (tick_accounting_disabled())
vtime_gen_account_irq_exit(tsk);
}
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 97077c282626..84b2d24a2238 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -471,7 +471,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
* should do work on this invocation, or whether time keeping for
* this CPU is done in some other way.
*/
- if (vtime_accounting_enabled())
+ if (tick_accounting_disabled())
return;
if (sched_clock_irqtime) {
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 914259128145..3bb5a7accc9f 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -924,7 +924,7 @@ static void tick_nohz_account_idle_ticks(struct tick_sched *ts)
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
unsigned long ticks;
- if (vtime_accounting_enabled())
+ if (tick_accounting_disabled())
return;
/*
* We stopped the tick in idle. Update process times would miss the
--
2.1.0
next prev parent reply other threads:[~2015-06-24 14:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 14:57 [RFC INCOMPLETE] tick based timekeeping from a housekeeping CPU riel
2015-06-24 14:57 ` [RFC PATCH 01/11] nohz,time: make account_process_tick work on the task's CPU riel
2015-06-24 14:57 ` riel [this message]
2015-06-24 14:57 ` [RFC PATCH 03/11] time,nohz: add cpu parameter to irqtime_account_process_tick riel
2015-06-24 14:57 ` [RFC PATCH 04/11] time,nohz: add cpu parameter to steal_account_process_tick riel
2015-06-24 14:57 ` [RFC PATCH 05/11] time,nohz: add cpu parameter to account_steal_time riel
2015-06-24 14:57 ` [RFC PATCH 06/11] time,nohz: add cpu parameter to account_idle_time riel
2015-06-24 14:57 ` [RFC PATCH 07/11] nohz,timer: designate timer housekeeping cpu riel
2015-06-24 14:57 ` [RFC PATCH 08/11] nohz,timer: have housekeeper call account_process_tick for nohz cpus riel
2015-06-30 14:23 ` Frederic Weisbecker
2015-06-24 14:57 ` [RFC PATCH 09/11] nohz,time: add tick_accounting_remote macro riel
2015-06-24 14:57 ` [RFC PATCH 10/11] nohz,kvm,time: skip vtime accounting at kernel entry & exit riel
2015-06-24 15:08 ` Andy Lutomirski
2015-06-24 14:58 ` [RFC PATCH 11/11] nohz,kvm,time: teach account_process_tick about guest time riel
2015-06-24 15:06 ` Andy Lutomirski
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=1435157880-22925-3-git-send-email-riel@redhat.com \
--to=riel@redhat.com \
--cc=fweisbec@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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®