]> git.baikalelectronics.ru Git - kernel.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)
commite67ef7a29628563f67689d9047ead3e498074c47
treed8c2d6c9eaf946a10b35ca415752b2d15ddaaad5
parentbe8d937483e6d88a4bae4ef41a7970a8639afcda
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