public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] Increase the number of IRQ descriptors for SPARSEIRQ
@ 2023-05-19 13:48 Shanker Donthineni
  2023-05-19 13:49 ` [PATCH v5 1/3] genirq: Use hlist for managing resend handlers Shanker Donthineni
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Shanker Donthineni @ 2023-05-19 13:48 UTC (permalink / raw)
  To: Thomas Gleixner, Marc Zyngier
  Cc: Sebastian Andrzej Siewior, Michael Walle, Shanker Donthineni,
	linux-kernel, Vikram Sethi, Jason Sequeira

The ARM64 architecture uses SPARSEIRQ with a default value of NR_IRQS,
which is set to 64. This means that only 64+8192 IRQ descriptors are
allowed, which may not be sufficient for modern ARM64 servers that
have a large number of IO devices and GIC hardware that supports
direct vSGI and vLPI injection features.

This limitation has caused issues when attempting to launch multiple
virtual machines with GICv4.1 features, resulting in the error message
'kvm_err("VPE IRQ allocation failure\n")'. The root cause of this issue
is the ~8K IRQ descriptor limit.

To address this issue, an initial proposal was made to define NR_IRQS
to 2^19 for ARM64. However, Marc Zyngier suggested implementing a
generic solution instead of hard-coded values. Thomas Gleixner advised
to use the maple tree data structure and provided most of the necessary
functions.

For more information, refer to the discussion thread at
https://lore.kernel.org/linux-arm-kernel/20230104023738.1258925-1-sdonthineni@nvidia.com/.

This patch series converts the static memory allocation to dynamic using
the maple tree, and increases the maximum number of IRQ descriptors to
INT_MAX from NR_IRQS+8192. This change has been tested on an ARM64 server
with CONFIG_SPARSE_IRQ=y, where 256 virtual machines were launched,
creating a total of 128K+ IRQ descriptors, and IRQ injection was verified.

Teted on ARM64 system:
  - Normal boot with ~200 cores
  - CPU hot-unplug/hot-plug using sysfs
  - Booted virtual machines with PCIe device pass-through
  - Hot-unplug of CPU where vfio-pci interrupts are bounded

Changes in v5:
  - Change function name irq_find_next_irq() to irq_find_at_or_after()
  - Update comment to reflect the return value of irq_get_next_irq()

Changes in v4:
  - Fix the iterator function using mt_find() instead of nt_next()
  - Tested CPU hot-unplug and hot-plug on ARM64 system. This is
    completely broken before v4.

Changes in v3:
  - Edited commit text
  - Added a helper function irq_resend_init()
  - Rebased to v6.3-rc6

Changes in v2:
  - The patches have been updated to v6.3-rc5.
  - The patches 2/5 and 4/5 have been removed as they are unnecessary.
  - The review comments from Thomas have been addressed.


Shanker Donthineni (3):
  genirq: Use hlist for managing resend handlers
  genirq: Encapsulate sparse bitmap handling
  genirq: Use the maple tree for IRQ descriptors management

 include/linux/irqdesc.h |  3 ++
 kernel/irq/chip.c       |  1 +
 kernel/irq/internals.h  |  6 ++--
 kernel/irq/irqdesc.c    | 77 +++++++++++++++++++++++++----------------
 kernel/irq/resend.c     | 47 ++++++++++++++++---------
 5 files changed, 86 insertions(+), 48 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-06-02  1:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-19 13:48 [PATCH v5 0/3] Increase the number of IRQ descriptors for SPARSEIRQ Shanker Donthineni
2023-05-19 13:49 ` [PATCH v5 1/3] genirq: Use hlist for managing resend handlers Shanker Donthineni
2023-05-24 10:01   ` [tip: irq/core] " tip-bot2 for Shanker Donthineni
2023-05-29  7:57   ` [PATCH v5 1/3] " Liao, Chang
2023-05-29  8:48     ` Marc Zyngier
2023-05-30  1:44       ` Liao, Chang
2023-05-30  7:27         ` Marc Zyngier
2023-05-29 21:51     ` Thomas Gleixner
2023-05-30  1:59       ` Liao, Chang
2023-05-30 12:19         ` Thomas Gleixner
2023-06-02  1:36           ` Liao, Chang
2023-05-19 13:49 ` [PATCH v5 2/3] genirq: Encapsulate sparse bitmap handling Shanker Donthineni
2023-05-24 10:01   ` [tip: irq/core] " tip-bot2 for Shanker Donthineni
2023-05-19 13:49 ` [PATCH v5 3/3] genirq: Use the maple tree for IRQ descriptors management Shanker Donthineni
2023-05-24 10:01   ` [tip: irq/core] genirq: Use a maple tree for interrupt descriptor management tip-bot2 for Shanker Donthineni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox