]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Jan 2024 16:10:33 +0000 (17:10 +0100)
commitaeeb4e4e49f8118d00cf803581555a2a2905759c
treef9bb759835c1fc6e8bff03469c78b9e6c3f84fb3
parent9e84d7bb15053bd260138b1aae59c038f7692218
genirq/affinity: Don't pass irq_affinity_desc array to irq_build_affinity_masks

[ Upstream commit e7bdd7f0cbd1c001bb9b4d3313edc5ee094bc3f8 ]

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
Stable-dep-of: 0263f92fadbb ("lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/irq/affinity.c