Re: [PATCH 4/4] sched/fair: Merge select_idle_core/cpu()

From: Mel Gorman
Date: Wed Jan 27 2021 - 08:24:27 EST


On Wed, Jan 27, 2021 at 02:07:50PM +0100, Vincent Guittot wrote:
> > @@ -6162,18 +6162,16 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t
> >
> > for_each_cpu_wrap(cpu, cpus, target) {
> > if (smt) {
> > - i = select_idle_core(p, cpu, cpus, &idle_cpu);
> > - if ((unsigned int)i < nr_cpumask_bits)
> > - return i;
> > + idle_cpu = select_idle_core(p, cpu, cpus, &idle_cpu);
>
> but how do you differentiate idle core (return value) and an idle cpu
> in the core set in &idle_cpu
>
> You will return as soon as a cpu is idle and before testing all cores
>

Bah, I'm sorry, I was context switching between multiple tasks and failed
to engage brain. I'll apply your hunk and resend. I don't think this
merits retesting as the saving of avoiding the intermeriate is marginal.

--
Mel Gorman
SUSE Labs