Re: [PATCH v2 0/3] Take the scheduling domain into account in numa balancin

From: Peter Zijlstra
Date: Tue Jan 07 2025 - 05:50:19 EST


On Fri, Jan 03, 2025 at 08:40:18PM +0800, Chuyi Zhou wrote:
> Hello Peter,
>
> 在 2025/1/3 19:36, Peter Zijlstra 写道:
> > Your $subject and actual patches do not patch.
> >
> > Your subject suggests you're taking the scheduling domains into account
> > for numa balancing, your actual patches are bunch of special case hacks
> > that totally ignore the actual sched domains
>
> The subject is indeed inappropriate, but the issues mentioned in this
> patchset still exist, right?
>
> - We should not consider isolated CPUs in numa_stats.
> - We should not select isolated CPUs as candidate CPUs.
>
> The current patch handle the above cases with hacks because I thought this
> kind of change is minimal to fix this issue. Perhaps you have a better
> solution for this issue? If so, please let me know, and I am more than
> willing to continue addressing this problem.

I would much rather see you do what the subject claims :-)

At the very least you should mask the whole thing against rq->rd->span
if there is a rq->rd at all ofcourse. This is not just the iteration in
update_numa_stats() but also the for_each_node_state() iteration.

I'm not sure there's anything saner than:

cpumask_intersects(rq->rd->span, cpumask_of_node(nid))