linux-stable/kernel/irq
Chen Yu daa5fa4535 genirq/matrix: Exclude managed interrupts in irq_matrix_allocated()
[ Upstream commit a0b0bad105 ]

When a CPU is about to be offlined, x86 validates that all active
interrupts which are targeted to this CPU can be migrated to the remaining
online CPUs. If not, the offline operation is aborted.

The validation uses irq_matrix_allocated() to retrieve the number of
vectors which are allocated on the outgoing CPU. The returned number of
allocated vectors includes also vectors which are associated to managed
interrupts.

That's overaccounting because managed interrupts are:

  - not migrated when the affinity mask of the interrupt targets only
    the outgoing CPU

  - migrated to another CPU, but in that case the vector is already
    pre-allocated on the potential target CPUs and must not be taken into
    account.

As a consequence the check whether the remaining online CPUs have enough
capacity for migrating the allocated vectors from the outgoing CPU might
fail incorrectly.

Let irq_matrix_allocated() return only the number of allocated non-managed
interrupts to make this validation check correct.

[ tglx: Amend changelog and fixup kernel-doc comment ]

Fixes: 2f75d9e1c9 ("genirq: Implement bitmap matrix allocator")
Reported-by: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20231020072522.557846-1-yu.c.chen@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:58:54 +01:00
..
affinity.c genirq/affinity: Move group_cpus_evenly() into lib/ 2023-01-17 18:50:06 +01:00
autoprobe.c genirq: Delay deactivation in free_irq() 2019-07-03 10:12:28 +02:00
chip.c genirq: Prevent nested thread vs synchronize_hardirq() deadlock 2023-07-31 17:24:22 +02:00
cpuhotplug.c sched/isolation: Use single feature type while referring to housekeeping cpumask 2022-02-16 15:57:55 +01:00
debug.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk 2018-02-01 13:36:15 -08:00
debugfs.c genirq: Allow fasteoi handler to resend interrupts on concurrent handling 2023-06-16 12:22:35 +01:00
devres.c genirq/devres: Use struct_size() in devm_kzalloc() 2019-04-16 21:54:03 +02:00
dummychip.c irq: Fix typos in comments 2021-03-22 04:23:14 +01:00
generic-chip.c genirq/generic_chip: Export irq_unmap_generic_chip 2022-07-20 12:05:55 +01:00
handle.c irq: remove unused flags argument from __handle_irq_event_percpu() 2022-01-07 00:25:25 +01:00
internals.h genirq: Remove unused extern declaration 2023-07-31 17:27:16 +02:00
ipi-mux.c genirq/ipi-mux: Use irq_domain_alloc_irqs() 2023-02-06 17:21:15 +00:00
ipi.c genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask() 2023-02-20 13:53:41 +01:00
irq_sim.c genirq/irq_sim: Make the irq_work always run in hard irq context 2022-05-14 17:48:27 +02:00
irqdesc.c genirq: Use a maple tree for interrupt descriptor management 2023-05-24 11:39:44 +02:00
irqdomain.c irqdomain: Use return value of strreplace() 2023-06-30 11:13:44 +02:00
Kconfig genirq: Add mechanism to multiplex a single HW IPI 2023-02-05 10:57:55 +00:00
Makefile genirq: Add mechanism to multiplex a single HW IPI 2023-02-05 10:57:55 +00:00
manage.c genirq: Prevent nested thread vs synchronize_hardirq() deadlock 2023-07-31 17:24:22 +02:00
matrix.c genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() 2023-11-20 11:58:54 +01:00
migration.c genirq: Fix typos and misspellings in comments 2021-03-16 15:08:29 +01:00
msi.c x86/pci/xen: populate MSI sysfs entries 2023-05-24 18:08:49 +02:00
pm.c genirq/PM: Unexport {suspend,resume}_device_irqs() 2022-06-13 12:27:37 +02:00
proc.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
resend.c genirq: Fix software resend lockup and nested resend 2023-08-26 19:14:31 +02:00
settings.h genirq: Add a IRQF_NO_DEBUG flag 2021-05-17 20:01:35 +02:00
spurious.c genirq: Disable irqfixup/poll on PREEMPT_RT. 2021-09-19 23:01:15 +02:00
timings.c Updates to the interrupt core and driver subsystems: 2021-08-30 14:38:37 -07:00