genirq/affinity: Improve __irq_build_affinity_masks()
authorMing Lei <ming.lei@redhat.com>
Fri, 16 Aug 2019 02:28:48 +0000 (10:28 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 27 Aug 2019 14:31:17 +0000 (16:31 +0200)
commit53c1788b7d7720565214a466afffdc818d8c6e5f
tree01b97c870e8d6dd73c1b3c3b720ec4b54663d0cc
parentb6a32bbd8735def2d0d696ba59205d1874b7800f
genirq/affinity: Improve __irq_build_affinity_masks()

One invariant of __irq_build_affinity_masks() is that all CPUs in the
specified masks (cpu_mask AND node_to_cpumask for each node) should be
covered during the spread. Even though all requested vectors have been
reached, it's still required to spread vectors among remained CPUs. A
similar policy has been taken in case of 'numvecs <= nodes' already.

So remove the following check inside the loop:

if (done >= numvecs)
break;

Meantime assign at least 1 vector for remaining nodes if 'numvecs' vectors
have been handled already.

Also, if the specified cpumask for one numa node is empty, simply do not
spread vectors on this node.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190816022849.14075-2-ming.lei@redhat.com
kernel/irq/affinity.c