Continuing a thread from a bit ago... Nitesh Narayan Lal wrote:
> > After a little more digging, I found out why cpumask_local_spread change > > affects the general/initial smp_affinity for certain device IRQs. > > > > After the introduction of the commit: > > > > e2e64a932 genirq: Set initial affinity in irq_set_affinity_hint() > > > > Continuing the conversation about the above commit and adding Jesse. > I was trying to understand the problem that the commit message explains > "The default behavior of the kernel is somewhat undesirable as all > requested interrupts end up on CPU0 after registration.", I have also been > trying to reproduce this behavior without the patch but I failed in doing > so, maybe because I am missing something here. > > @Jesse Can you please explain? FWIU IRQ affinity should be decided based on > the default affinity mask. The original issue as seen, was that if you rmmod/insmod a driver *without* irqbalance running, the default irq mask is -1, which means any CPU. The older kernels (this issue was patched in 2014) used to use that affinity mask, but the value programmed into all the interrupt registers "actual affinity" would end up delivering all interrupts to CPU0, and if the machine was under traffic load incoming when the driver loaded, CPU0 would start to poll among all the different netdev queues, all on CPU0. The above then leads to the condition that the device is stuck polling even if the affinity gets updated from user space, and the polling will continue until traffic stops. > The problem with the commit is that when we overwrite the affinity mask > based on the hinting mask we completely ignore the default SMP affinity > mask. If we do want to overwrite the affinity based on the hint mask we > should atleast consider the default SMP affinity. Maybe the right thing is to fix which CPUs are passed in as the valid mask, or make sure the kernel cross checks that what the driver asks for is a "valid CPU"?