sched/vtime: Rename vtime_accounting_cpu_enabled() to vtime_accounting_enabled_this_cpu()
authorFrederic Weisbecker <frederic@kernel.org>
Wed, 16 Oct 2019 02:56:54 +0000 (04:56 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 29 Oct 2019 09:01:14 +0000 (10:01 +0100)
Standardize the naming on top of the vtime_accounting_enabled_*() base.
Also make it clear we are checking the vtime state of the
*current* CPU with this function. We'll need to add an API to check that
state on remote CPUs as well, so we must disambiguate the naming.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J . Wysocki <rjw@rjwysocki.net>
Cc: Rik van Riel <riel@surriel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Wanpeng Li <wanpengli@tencent.com>
Cc: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Link: https://lkml.kernel.org/r/20191016025700.31277-9-frederic@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/context_tracking.h
include/linux/vtime.h
kernel/sched/cputime.c
kernel/time/tick-sched.c

index c9065ad518a712b4bd8df9eb720d01fa7fe146dd..64ec82851aa38a36bab4780e7f5a87df573f23cd 100644 (file)
@@ -103,7 +103,7 @@ static inline void context_tracking_init(void) { }
 /* must be called with irqs disabled */
 static inline void guest_enter_irqoff(void)
 {
-       if (vtime_accounting_cpu_enabled())
+       if (vtime_accounting_enabled_this_cpu())
                vtime_guest_enter(current);
        else
                current->flags |= PF_VCPU;
@@ -127,7 +127,7 @@ static inline void guest_exit_irqoff(void)
        if (context_tracking_enabled())
                __context_tracking_exit(CONTEXT_GUEST);
 
-       if (vtime_accounting_cpu_enabled())
+       if (vtime_accounting_enabled_this_cpu())
                vtime_guest_exit(current);
        else
                current->flags &= ~PF_VCPU;
index 54e91511250b9ccbef6d34e09fb69f7cd4ea9533..eb2e7a19054b43ddd7cdb6b180afc947ca826f9f 100644 (file)
 struct task_struct;
 
 /*
- * vtime_accounting_cpu_enabled() definitions/declarations
+ * vtime_accounting_enabled_this_cpu() definitions/declarations
  */
 #if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE)
 
-static inline bool vtime_accounting_cpu_enabled(void) { return true; }
+static inline bool vtime_accounting_enabled_this_cpu(void) { return true; }
 extern void vtime_task_switch(struct task_struct *prev);
 
 #elif defined(CONFIG_VIRT_CPU_ACCOUNTING_GEN)
@@ -31,7 +31,7 @@ static inline bool vtime_accounting_enabled(void)
        return context_tracking_enabled();
 }
 
-static inline bool vtime_accounting_cpu_enabled(void)
+static inline bool vtime_accounting_enabled_this_cpu(void)
 {
        if (vtime_accounting_enabled()) {
                if (context_tracking_enabled_this_cpu())
@@ -45,13 +45,13 @@ extern void vtime_task_switch_generic(struct task_struct *prev);
 
 static inline void vtime_task_switch(struct task_struct *prev)
 {
-       if (vtime_accounting_cpu_enabled())
+       if (vtime_accounting_enabled_this_cpu())
                vtime_task_switch_generic(prev);
 }
 
 #else /* !CONFIG_VIRT_CPU_ACCOUNTING */
 
-static inline bool vtime_accounting_cpu_enabled(void) { return false; }
+static inline bool vtime_accounting_enabled_this_cpu(void) { return false; }
 static inline void vtime_task_switch(struct task_struct *prev) { }
 
 #endif
index 34086afc3518bb4f51425ff8515db5880c65fe9a..b931a19df09326f61fbefc2773857215adcca8e5 100644 (file)
@@ -475,7 +475,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
        u64 cputime, steal;
        struct rq *rq = this_rq();
 
-       if (vtime_accounting_cpu_enabled())
+       if (vtime_accounting_enabled_this_cpu())
                return;
 
        if (sched_clock_irqtime) {
index 955851748dc38248a3f8bec2fe9e25212aeb583d..c2748232f607b6fb100ece623798af4553246f50 100644 (file)
@@ -1119,7 +1119,7 @@ static void tick_nohz_account_idle_ticks(struct tick_sched *ts)
 #ifndef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
        unsigned long ticks;
 
-       if (vtime_accounting_cpu_enabled())
+       if (vtime_accounting_enabled_this_cpu())
                return;
        /*
         * We stopped the tick in idle. Update process times would miss the