Re: [PATCH 12/12] sched/numa: Stop an exhastive search if a reasonable swap candidate or idle CPU is found

From: Mel Gorman
Date: Fri Feb 14 2020 - 07:03:13 EST


On Fri, Feb 14, 2020 at 07:47:46PM +0800, Hillf Danton wrote:
> > +
> > + /*
> > + * If a move to idle is allowed because there is capacity or load
> > + * balance improves then stop the search. While a better swap
> > + * candidate may exist, a search is not free.
> > + */
> > + if (maymove && !cur && env->best_cpu >= 0 && idle_cpu(env->best_cpu))
> > + stopsearch = true;
> > +
> > + /*
> > + * If a swap candidate must be identified and the current best task
> > + * moves its preferred node then stop the search.
> > + */
> > + if (!maymove && env->best_task &&
> > + env->best_task->numa_preferred_nid == env->src_nid) {
> > + return true;
>
> Take another look at the lock left behind please.
>

/me slaps self

Thanks

--
Mel Gorman
SUSE Labs