Re: [PATCH v7] sched/fair: Consider cpu affinity when allowing NUMA imbalance in find_idlest_group

From: Peter Zijlstra
Date: Fri Jun 10 2022 - 11:02:45 EST


On Fri, Jun 10, 2022 at 04:42:05PM +0200, Vincent Guittot wrote:

> The test was there to not do the computation with cpumask_and() if the
> task's affinity has not been modified so maybe it would be enough to
> test (p->nr_cpus_allowed != NR_CPUS) to check if the task's affinity
> has been modified and we have we do the cpumask_and() and
> cpumask_weight()

Yeah, I suppose that's the best we can do. I was thinking that perhaps
some cgroup/cpuset thing is common these days, in which case pretty much
all tasks will have their affinity set through the cpuset muck, but
alas, nothing really do be done about that.