[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181120140458.GU2131@hirez.programming.kicks-ass.net>
Date: Tue, 20 Nov 2018 15:04:58 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Frederic Weisbecker <frederic@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Wanpeng Li <wanpengli@...cent.com>,
Thomas Gleixner <tglx@...utronix.de>,
Yauheni Kaliuta <yauheni.kaliuta@...hat.com>,
Ingo Molnar <mingo@...nel.org>, Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH 15/25] sched/vtime: Introduce
vtime_accounting_enabled_cpu()
On Wed, Nov 14, 2018 at 03:45:59AM +0100, Frederic Weisbecker wrote:
> This allows us to check if a remote CPU runs vtime accounting
> (ie: is nohz_full). We'll need that to reliably support "nice"
> accounting on kcpustat.
>
> Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
> Cc: Yauheni Kaliuta <yauheni.kaliuta@...hat.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Rik van Riel <riel@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Wanpeng Li <wanpengli@...cent.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> ---
> include/linux/vtime.h | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/include/linux/vtime.h b/include/linux/vtime.h
> index 82fed7a..a53f6ea 100644
> --- a/include/linux/vtime.h
> +++ b/include/linux/vtime.h
> @@ -31,6 +31,16 @@ static inline bool vtime_accounting_enabled(void)
> return context_tracking_enabled();
> }
>
> +static inline bool vtime_accounting_enabled_cpu(int cpu)
> +{
> + if (vtime_accounting_enabled()) {
> + if (context_tracking_enabled_cpu(cpu))
> + return true;
> + }
> +
> + return false;
> +}
static inline bool vtime_account_enabled_cpu(int cpu)
{
return vtime_account_enabled() && context_tracking_enabled_cpu(cpu);
}
Hmm?
Powered by blists - more mailing lists