[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201023103407.GK2594@hirez.programming.kicks-ass.net>
Date: Fri, 23 Oct 2020 12:34:07 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Ingo Molnar <mingo@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Juri Lelli <juri.lelli@...hat.com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
linux-kernel@...r.kernel.org, Quentin Perret <qperret@...gle.com>,
Lukasz Luba <lukasz.luba@....com>, linux-pm@...r.kernel.org
Subject: Re: [PATCH V2 1/2] sched/core: Rename and move schedutil_cpu_util()
to core.c
On Fri, Oct 23, 2020 at 03:50:20PM +0530, Viresh Kumar wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index d2003a7d5ab5..369ff54d11d4 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -5117,6 +5117,119 @@ struct task_struct *idle_task(int cpu)
> return cpu_rq(cpu)->idle;
> }
>
> +/*
> + * This function computes an effective utilization for the given CPU, to be
> + * used for frequency selection given the linear relation: f = u * f_max.
> + *
> + * The scheduler tracks the following metrics:
> + *
> + * cpu_util_{cfs,rt,dl,irq}()
> + * cpu_bw_dl()
> + *
> + * Where the cfs,rt and dl util numbers are tracked with the same metric and
> + * synchronized windows and are thus directly comparable.
> + *
> + * The cfs,rt,dl utilization are the running times measured with rq->clock_task
> + * which excludes things like IRQ and steal-time. These latter are then accrued
> + * in the irq utilization.
> + *
> + * The DL bandwidth number otoh is not a measured metric but a value computed
> + * based on the task model parameters and gives the minimal utilization
> + * required to meet deadlines.
> + */
> +unsigned long effective_cpu_util(int cpu, unsigned long util_cfs,
> + unsigned long max, enum cpu_util_type type,
> + struct task_struct *p)
> +{
...
> +}
> +
> +unsigned long sched_cpu_util(int cpu, enum cpu_util_type type,
> + unsigned long max)
> +{
> + return effective_cpu_util(cpu, cpu_util_cfs(cpu_rq(cpu)), max, type,
> + NULL);
> +}
Shouldn't all that be: #ifdef CONFIG_SMP ?
Powered by blists - more mailing lists