[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210804102236.GB6464@techsingularity.net>
Date: Wed, 4 Aug 2021 11:22:36 +0100
From: Mel Gorman <mgorman@...hsingularity.net>
To: "Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
Valentin Schneider <valentin.schneider@....com>,
Aubrey Li <aubrey.li@...ux.intel.com>,
yangyicong <yangyicong@...wei.com>
Subject: Re: [PATCH 7/9] sched/fair: Enforce proportional scan limits when
scanning for an idle core
On Mon, Aug 02, 2021 at 10:52:01AM +0000, Song Bao Hua (Barry Song) wrote:
> > @@ -6265,30 +6265,35 @@ static int select_idle_cpu(struct task_struct *p, struct
> > sched_domain *sd, bool
> > if (has_idle_core) {
> > i = select_idle_core(p, cpu, cpus, &idle_cpu);
> > if ((unsigned int)i < nr_cpumask_bits)
> > - return i;
> > + break;
> >
> > + nr -= sched_smt_weight;
> > } else {
> > - if (!--nr)
> > - return -1;
> > idle_cpu = __select_idle_cpu(cpu, p);
> > if ((unsigned int)idle_cpu < nr_cpumask_bits)
> > break;
> > + nr--;
> > }
> > +
> > + if (nr < 0)
> > + break;
> > }
> >
> > - if (has_idle_core)
> > - set_idle_cores(target, false);
> > + if ((unsigned int)idle_cpu < nr_cpumask_bits) {
> > + if (has_idle_core)
> > + set_idle_cores(target, false);
> >
>
> For example, if we have 16 cpus(8 SMT2 cores). In case core7 is idle,
> we only have scanned core0+core1(cpu0-cpu3) and if these two cores
> are not idle, but here we set has_idle_cores to false while core7 is
> idle. It seems incorrect.
>
Yep, that block needs to be revisited.
--
Mel Gorman
SUSE Labs
Powered by blists - more mailing lists