[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200522145716.GB600689@localhost.localdomain>
Date: Fri, 22 May 2020 16:57:16 +0200
From: Juri Lelli <juri.lelli@...hat.com>
To: Dietmar Eggemann <dietmar.eggemann@....com>
Cc: Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Steven Rostedt <rostedt@...dmis.org>,
Luca Abeni <luca.abeni@...tannapisa.it>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Wei Wang <wvw@...gle.com>, Quentin Perret <qperret@...gle.com>,
Alessio Balsini <balsini@...gle.com>,
Pavan Kondeti <pkondeti@...eaurora.org>,
Patrick Bellasi <patrick.bellasi@...bug.net>,
Morten Rasmussen <morten.rasmussen@....com>,
Valentin Schneider <valentin.schneider@....com>,
Qais Yousef <qais.yousef@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/5] sched/deadline: Optimize dl_bw_cpus()
On 20/05/20 15:42, Dietmar Eggemann wrote:
> Return the weight of the root domain (rd) span in case it is a subset
> of the cpu_active_mask.
>
> Continue to compute the number of CPUs over rd span and cpu_active_mask
> when in hotplug.
>
> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@....com>
> ---
> kernel/sched/deadline.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 504d2f51b0d6..4ae22bfc37ae 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -54,10 +54,16 @@ static inline struct dl_bw *dl_bw_of(int i)
> static inline int dl_bw_cpus(int i)
> {
> struct root_domain *rd = cpu_rq(i)->rd;
> - int cpus = 0;
> + int cpus;
>
> RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held(),
> "sched RCU must be held");
> +
> + if (cpumask_subset(rd->span, cpu_active_mask))
> + return cpumask_weight(rd->span);
> +
> + cpus = 0;
> +
> for_each_cpu_and(i, rd->span, cpu_active_mask)
> cpus++;
>
> --
Acked-by: Juri Lelli <juri.lelli@...hat.com>
Powered by blists - more mailing lists