Re: [PATCH RFC 1/3] cpumask: Honor irq_default_affinity in cpumask_local_spread()
From: Sebastian Andrzej Siewior
Date: Thu Aug 20 2026 - 12:12:54 EST
On 2026-08-19 14:38:22 [-0400], Yury Norov wrote:
> > --- a/lib/cpumask.c
> > +++ b/lib/cpumask.c
> > @@ -81,8 +82,9 @@ void __init free_bootmem_cpumask_var(cpumask_var_t mask)
> > * @i: index number
> > * @node: local numa_node
> > *
> > - * Return: online CPU according to a numa aware policy; local cpus are returned
> > - * first, followed by non-local ones, then it wraps around.
> > + * Return: online CPU according to the default IRQ affinity and a numa aware
> > + * policy; local cpus are returned first, followed by non-local ones, then it
> > + * wraps around.
> > *
> > * For those who wants to enumerate all CPUs based on their NUMA distances,
> > * i.e. call this function in a loop, like:
> > @@ -110,9 +112,9 @@ unsigned int cpumask_local_spread(unsigned int i, int node)
>
> Please don't touch this function. There's ~40 users, and we don't want
> to inspect every caller for their intention.
While this might be okay for the NICs, the usage of PMUs shouldn't be
changed. So yes, Yury's suggestion to create your own function and then
move the drivers one by one makes sense.
You might also want to verify that your setup/ design works on some
"newer" multi queue NICs even after the number of queues is reconfigured
at runtime.
There is also netif_set_affinity_auto().
Sebastian