Messages in this thread Patch in this message | | | From | riel@redhat ... | Subject | [RFC PATCH 02/11] time,nohz: rename vtime_accounting_enabled to tick_accounting_disabled | Date | Wed, 24 Jun 2015 10:57:51 -0400 |
| |
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
| |