genirq/affinity: Don't pass irq_affinity_desc array to irq_build_affinity_masks
authorMing Lei <ming.lei@redhat.com>
Tue, 27 Dec 2022 02:29:02 +0000 (10:29 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 17 Jan 2023 17:50:06 +0000 (18:50 +0100)
commite7bdd7f0cbd1c001bb9b4d3313edc5ee094bc3f8
treed7497f8c9f4c6dbe12ce1c61897b72d0445e6c9c
parent1f962d91a15af54301c63febb8ac2ba07aa3654f
genirq/affinity: Don't pass irq_affinity_desc array to irq_build_affinity_masks

Prepare for abstracting irq_build_affinity_masks() into a public function
for assigning all CPUs evenly into several groups.

Don't pass irq_affinity_desc array to irq_build_affinity_masks, instead
return a cpumask array by storing each assigned group into one element of
the array.

This allows to provide a generic interface for grouping all CPUs evenly
from a NUMA and CPU locality viewpoint, and the cost is one extra allocation
in irq_build_affinity_masks(), which should be fine since it is done via
GFP_KERNEL and irq_build_affinity_masks() is a slow path anyway.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/20221227022905.352674-4-ming.lei@redhat.com
kernel/irq/affinity.c