Commit 55dbdcfa authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar

sched/cputime: Rename vtime_accounting_enabled() to vtime_accounting_cpu_enabled()

vtime_accounting_enabled() checks if vtime is running on the current CPU
and is as such a misnomer. Lets rename it to a function that reflect its
locality. We are going to need the current name for a function that tells
if vtime runs at all on some CPU.
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul E . McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1447948054-28668-6-git-send-email-fweisbec@gmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent cab245d6
...@@ -86,7 +86,7 @@ static inline void context_tracking_init(void) { } ...@@ -86,7 +86,7 @@ static inline void context_tracking_init(void) { }
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
static inline void guest_enter(void) static inline void guest_enter(void)
{ {
if (vtime_accounting_enabled()) if (vtime_accounting_cpu_enabled())
vtime_guest_enter(current); vtime_guest_enter(current);
else else
current->flags |= PF_VCPU; current->flags |= PF_VCPU;
...@@ -100,7 +100,7 @@ static inline void guest_exit(void) ...@@ -100,7 +100,7 @@ static inline void guest_exit(void)
if (context_tracking_is_enabled()) if (context_tracking_is_enabled())
__context_tracking_exit(CONTEXT_GUEST); __context_tracking_exit(CONTEXT_GUEST);
if (vtime_accounting_enabled()) if (vtime_accounting_cpu_enabled())
vtime_guest_exit(current); vtime_guest_exit(current);
else else
current->flags &= ~PF_VCPU; current->flags &= ~PF_VCPU;
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
struct task_struct; struct task_struct;
/* /*
* vtime_accounting_enabled() definitions/declarations * vtime_accounting_cpu_enabled() definitions/declarations
*/ */
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
static inline bool vtime_accounting_enabled(void) { return true; } static inline bool vtime_accounting_cpu_enabled(void) { return true; }
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ #endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
static inline bool vtime_accounting_enabled(void) static inline bool vtime_accounting_cpu_enabled(void)
{ {
if (context_tracking_is_enabled()) { if (context_tracking_is_enabled()) {
if (context_tracking_cpu_is_enabled()) if (context_tracking_cpu_is_enabled())
...@@ -29,7 +29,7 @@ static inline bool vtime_accounting_enabled(void) ...@@ -29,7 +29,7 @@ static inline bool vtime_accounting_enabled(void)
#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */ #endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
#ifndef CONFIG_VIRT_CPU_ACCOUNTING #ifndef CONFIG_VIRT_CPU_ACCOUNTING
static inline bool vtime_accounting_enabled(void) { return false; } static inline bool vtime_accounting_cpu_enabled(void) { return false; }
#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */ #endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
...@@ -44,7 +44,7 @@ extern void vtime_task_switch(struct task_struct *prev); ...@@ -44,7 +44,7 @@ extern void vtime_task_switch(struct task_struct *prev);
extern void vtime_common_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) static inline void vtime_task_switch(struct task_struct *prev)
{ {
if (vtime_accounting_enabled()) if (vtime_accounting_cpu_enabled())
vtime_common_task_switch(prev); vtime_common_task_switch(prev);
} }
#endif /* __ARCH_HAS_VTIME_TASK_SWITCH */ #endif /* __ARCH_HAS_VTIME_TASK_SWITCH */
...@@ -59,7 +59,7 @@ extern void vtime_account_irq_enter(struct task_struct *tsk); ...@@ -59,7 +59,7 @@ extern void vtime_account_irq_enter(struct task_struct *tsk);
extern void vtime_common_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) static inline void vtime_account_irq_enter(struct task_struct *tsk)
{ {
if (vtime_accounting_enabled()) if (vtime_accounting_cpu_enabled())
vtime_common_account_irq_enter(tsk); vtime_common_account_irq_enter(tsk);
} }
#endif /* __ARCH_HAS_VTIME_ACCOUNT */ #endif /* __ARCH_HAS_VTIME_ACCOUNT */
...@@ -78,7 +78,7 @@ extern void vtime_gen_account_irq_exit(struct task_struct *tsk); ...@@ -78,7 +78,7 @@ extern void vtime_gen_account_irq_exit(struct task_struct *tsk);
static inline void vtime_account_irq_exit(struct task_struct *tsk) static inline void vtime_account_irq_exit(struct task_struct *tsk)
{ {
if (vtime_accounting_enabled()) if (vtime_accounting_cpu_enabled())
vtime_gen_account_irq_exit(tsk); vtime_gen_account_irq_exit(tsk);
} }
......
...@@ -466,7 +466,7 @@ void account_process_tick(struct task_struct *p, int user_tick) ...@@ -466,7 +466,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
cputime_t one_jiffy_scaled = cputime_to_scaled(cputime_one_jiffy); cputime_t one_jiffy_scaled = cputime_to_scaled(cputime_one_jiffy);
struct rq *rq = this_rq(); struct rq *rq = this_rq();
if (vtime_accounting_enabled()) if (vtime_accounting_cpu_enabled())
return; return;
if (sched_clock_irqtime) { if (sched_clock_irqtime) {
......
...@@ -875,7 +875,7 @@ static void tick_nohz_account_idle_ticks(struct tick_sched *ts) ...@@ -875,7 +875,7 @@ static void tick_nohz_account_idle_ticks(struct tick_sched *ts)
#ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
unsigned long ticks; unsigned long ticks;
if (vtime_accounting_enabled()) if (vtime_accounting_cpu_enabled())
return; return;
/* /*
* We stopped the tick in idle. Update process times would miss the * We stopped the tick in idle. Update process times would miss the
......
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