From: Matt Turner <mattst88@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>,
Magnus Lindholm <linmag7@gmail.com>, Kees Cook <kees@kernel.org>,
Marco Elver <elver@google.com>,
Andrey Konovalov <andreyknvl@gmail.com>,
Andrey Ryabinin <ryabinin.a.a@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
kasan-dev@googlegroups.com, linux-hardening@vger.kernel.org,
linux-doc@vger.kernel.org, Matt Turner <mattst88@gmail.com>
Subject: [PATCH v2 22/22] alpha: select SPARSE_IRQ
Date: Sat, 05 Sep 2026 15:29:43 -0400 [thread overview]
Message-ID: <20260905-arch-kconfig-options-v2-v2-22-83e8245761a2@gmail.com> (raw)
In-Reply-To: <20260905-arch-kconfig-options-v2-v2-0-83e8245761a2@gmail.com>
NR_IRQS on Alpha is sized for the largest configuration each platform
supports, and for Marvel that is 32 PIDs, or 32784 interrupts. Without
SPARSE_IRQ that becomes a static irq_desc[] array of 12.6 MB in .data,
carried by every Marvel and every generic kernel regardless of how many
interrupts the machine actually has. A real ES47 uses 87 of them.
That is not just wasted memory, it constrains where the kernel can be
loaded. The image links at a fixed 0xfffffc0001010000, just above the
console's low memory reservation, and with memory striping enabled the
console leaves only about 16 MB of usable low memory before the rest is
relocated to an interleaved aperture. A 12.6 MB array of mostly unused
interrupt descriptors is the difference between fitting and not.
Alpha already goes through irq_to_desc() rather than indexing irq_desc[]
directly, so nothing stands in the way. The platforms do wire up their
interrupts by number, though, which needs the descriptors to exist by
then, so provide arch_probe_nr_irqs() returning the machine vector's
count instead of taking the NR_IRQS_LEGACY default. Without it every
interrupt above 15 would have no descriptor and the handler setup would
be silently dropped.
Tested on an ES47 (Marvel, 2 EV7z): boots with all device interrupts
working, and .data drops by 12.6 MB, from 15.7 MB to 3.1 MB.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Tested-by: Magnus Lindholm <linmag7@gmail.com>
Reviewed-by: Magnus Lindholm <linmag7@gmail.com>
---
arch/alpha/Kconfig | 1 +
arch/alpha/kernel/irq_alpha.c | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 96b38d320eb8..8efb2da3246f 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -64,6 +64,7 @@ config ALPHA
select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
select MMU_GATHER_NO_RANGE
select MMU_GATHER_RCU_TABLE_FREE
+ select SPARSE_IRQ
select SPARSEMEM_EXTREME if SPARSEMEM
select SYSCTL_EXCEPTION_TRACE
select ZONE_DMA
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index f90ff898a71a..8366d6de439d 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -152,6 +152,19 @@ common_init_isa_dma(void)
outb(0, DMA2_CLR_MASK_REG);
}
+/*
+ * The platforms wire up their interrupts by calling into the generic irq
+ * code with fixed interrupt numbers, so the descriptors have to exist by
+ * then. Preallocate the machine's full complement rather than take the
+ * NR_IRQS_LEGACY default, which would leave everything above IRQ 15
+ * without a descriptor and silently drop the handler setup.
+ */
+int __init
+arch_probe_nr_irqs(void)
+{
+ return alpha_mv.nr_irqs;
+}
+
void __init
init_IRQ(void)
{
--
2.54.0
next prev parent reply other threads:[~2026-09-05 19:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 19:29 [PATCH v2 00/22] alpha: catch up on architecture Kconfig options Matt Turner
2026-09-05 19:29 ` [PATCH v2 01/22] alpha: enter hardirq context before looking up the irq descriptor Matt Turner
2026-09-06 8:53 ` Magnus Lindholm
2026-09-05 19:29 ` [PATCH v2 02/22] alpha: select ARCH_HAS_UBSAN Matt Turner
2026-09-05 19:29 ` [PATCH v2 03/22] alpha: select ARCH_HAS_GCOV_PROFILE_ALL Matt Turner
2026-09-05 19:29 ` [PATCH v2 04/22] alpha: select HAVE_DEBUG_KMEMLEAK Matt Turner
2026-09-05 19:29 ` [PATCH v2 05/22] alpha: select EDAC_SUPPORT Matt Turner
2026-09-05 19:29 ` [PATCH v2 06/22] alpha: select ARCH_SUPPORTS_ATOMIC_RMW Matt Turner
2026-09-05 19:29 ` [PATCH v2 07/22] alpha: select ARCH_HAS_FAST_MULTIPLIER Matt Turner
2026-09-05 19:29 ` [PATCH v2 08/22] alpha: select ARCH_SUPPORTS_INT128 Matt Turner
2026-10-09 6:52 ` Magnus Lindholm
2026-10-10 2:20 ` [PATCH] alpha: add 128-bit shift helpers Matt Turner
2026-09-05 19:29 ` [PATCH v2 09/22] alpha: select HAVE_ARCH_COMPILER_H Matt Turner
2026-09-05 19:29 ` [PATCH v2 10/22] alpha: select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE Matt Turner
2026-09-05 19:29 ` [PATCH v2 11/22] alpha: add HAVE_ARCH_THREAD_STRUCT_WHITELIST support Matt Turner
2026-09-05 19:29 ` [PATCH v2 12/22] alpha: add ARCH_HAS_PTE_SPECIAL support Matt Turner
2026-09-05 19:29 ` [PATCH v2 13/22] alpha: add ARCH_SUPPORTS_PAGE_TABLE_CHECK support Matt Turner
2026-09-06 19:53 ` Magnus Lindholm
2026-09-05 19:29 ` [PATCH v2 14/22] alpha: select ARCH_HAS_DEBUG_VM_PGTABLE Matt Turner
2026-09-05 19:29 ` [PATCH v2 15/22] alpha: select HAVE_GUP_FAST Matt Turner
2026-09-05 19:29 ` [PATCH v2 16/22] alpha: select ARCH_USE_MEMTEST Matt Turner
2026-09-05 19:29 ` [PATCH v2 17/22] alpha: select SYSCTL_EXCEPTION_TRACE Matt Turner
2026-09-05 19:29 ` [PATCH v2 18/22] alpha: discard .eh_frame and the relocation sections Matt Turner
2026-09-05 19:29 ` [PATCH v2 19/22] alpha: select ARCH_WANT_LD_ORPHAN_WARN Matt Turner
2026-09-05 19:29 ` [PATCH v2 20/22] alpha: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM Matt Turner
2026-09-05 19:29 ` [PATCH v2 21/22] alpha: add HAVE_PERF_REGS and HAVE_PERF_USER_STACK_DUMP support Matt Turner
2026-09-06 20:44 ` Magnus Lindholm
2026-09-06 20:48 ` Matt Turner
2026-09-05 19:29 ` Matt Turner [this message]
2026-09-06 21:18 ` [PATCH v2 00/22] alpha: catch up on architecture Kconfig options Magnus Lindholm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260905-arch-kconfig-options-v2-v2-22-83e8245761a2@gmail.com \
--to=mattst88@gmail.com \
--cc=andreyknvl@gmail.com \
--cc=corbet@lwn.net \
--cc=elver@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kees@kernel.org \
--cc=linmag7@gmail.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=richard.henderson@linaro.org \
--cc=ryabinin.a.a@gmail.com \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®