]> git.karo-electronics.de Git - karo-tx-linux.git/commit
irq/affinity: Fix CPU spread for unbalanced nodes
authorKeith Busch <keith.busch@intel.com>
Mon, 3 Apr 2017 19:25:53 +0000 (15:25 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 4 Apr 2017 09:57:28 +0000 (11:57 +0200)
commit7bf8222b9bd0ba867e18b7f4537b61ef2e92eee8
treed8c2d6c9eaf946a10b35ca415752b2d15ddaaad5
parent08e4e0d0456d0ca8427b2d1ddffa30f1c3e774d7
irq/affinity: Fix CPU spread for unbalanced nodes

The irq_create_affinity_masks routine is responsible for assigning a
number of interrupt vectors to CPUs. The optimal assignemnet will spread
requested vectors to all CPUs, with the fewest CPUs sharing a vector.

The algorithm may fail to assign some vectors to any CPUs if a node's
CPU count is lower than the average number of vectors per node. These
vectors are unusable and create an un-optimal spread.

Recalculate the number of vectors to assign at each node iteration by using
the remaining number of vectors and nodes to be assigned, not exceeding the
number of CPUs in that node. This will guarantee that every CPU is assigned
at least one vector.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: linux-nvme@lists.infradead.org
Link: http://lkml.kernel.org/r/1491247553-7603-1-git-send-email-keith.busch@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/affinity.c