From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@osdl.org>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>, Andi Kleen <ak@suse.de>,
"Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] x86_64: Make NR_IRQS configurable in Kconfig
Date: Mon, 07 Aug 2006 16:10:14 -0600 [thread overview]
Message-ID: <m1slk89ozd.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20060807120454.79b6e1dc.rdunlap@xenotime.net> (Randy Dunlap's message of "Mon, 7 Aug 2006 12:04:54 -0700")
Currently on a SMP system we can theoretically support
NR_CPUS*224 irqs. Unfortunately our data structures
don't cope will with that many irqs, nor does hardware
typically provide that many irq sources.
With the number of cores starting to follow Moore's Law,
and the apicid limits being raised beyond an 8bit
number trying to track our current maximum with our
current data structures would be fatal and wasteful.
So this patch decouples the number of irqs we support
from the number of cpus. We can revisit this decision
once someone reworks the current data structures.
This version has my stupid typos fixed and the true maximum
exposed to make it clear that I have a low default. The
worst that I can see happening is there won't be any
per_cpu space left for modules if someone sets this
too high, but the system should still boot.
For non-SMP systems the default is no set to 224 IRQs.
The description has been reworded in an attempt
to make it clear what this option controls.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
arch/x86_64/Kconfig | 25 +++++++++++++++++++++++++
include/asm-x86_64/irq.h | 3 ++-
2 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 7598d99..adcbb21 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -384,6 +384,31 @@ config NR_CPUS
This is purely to save memory - each supported CPU requires
memory in the static kernel configuration.
+config NR_IRQS
+ int "Maximum number of IRQs (224-57344)"
+ range 224 57344
+ default "4096" if SMP
+ default "224" if !SMP
+ help
+ This option allows you to specify the maximum number of interrupt
+ sources your kernel will support. Architecturally there are
+ 224 interrupt destinations per cpu, so setting to a higher value
+ can be wasteful.
+
+ Many machines have irq controllers with unconnected interrupt
+ pins, leading to unused irq numbers in the kernel. Since a
+ destination is not assigned to an unused interrupt source
+ it can be reasonable to support more interrupt sources then
+ there are destinations to receive them.
+
+ The current recommended value is 4096 as it is slightly more irqs
+ than any known machine and still small enough to have a
+ reasonable memory consumption. Setting a noticeably larger value
+ will exhaust your per cpu memory, and waste memory in the per irq
+ arrays.
+
+ If unsure leave this at the default.
+
config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
depends on SMP && HOTPLUG && EXPERIMENTAL
diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h
index 5006c6e..b0f6460 100644
--- a/include/asm-x86_64/irq.h
+++ b/include/asm-x86_64/irq.h
@@ -31,7 +31,8 @@ #define NR_VECTORS 256
#define FIRST_SYSTEM_VECTOR 0xef /* duplicated in hw_irq.h */
-#define NR_IRQS (NR_VECTORS + (32 *NR_CPUS))
+/* We can be setup to receive at most NR_CPUS*224 irqs simultaneously */
+#define NR_IRQS (CONFIG_NR_IRQS)
#define NR_IRQ_VECTORS NR_IRQS
static __inline__ int irq_canonicalize(int irq)
--
1.4.2.rc3.g7e18e
next prev parent reply other threads:[~2006-08-07 22:11 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-07 15:26 Eric W. Biederman
2006-08-07 15:33 ` Andi Kleen
2006-08-07 15:55 ` Eric W. Biederman
2006-08-07 15:59 ` Randy.Dunlap
2006-08-07 16:11 ` Protasevich, Natalie
2006-08-07 16:17 ` Andi Kleen
2006-08-07 16:23 ` Protasevich, Natalie
2006-08-07 16:58 ` Eric W. Biederman
2006-08-07 16:44 ` Eric W. Biederman
2006-08-07 17:00 ` H. Peter Anvin
2006-08-07 17:46 ` Eric W. Biederman
2006-08-07 17:52 ` H. Peter Anvin
2006-08-07 17:30 ` Eric W. Biederman
2006-08-07 17:55 ` Randy.Dunlap
2006-08-07 18:16 ` Eric W. Biederman
2006-08-07 18:53 ` Eric W. Biederman
2006-08-07 19:04 ` Randy.Dunlap
2006-08-07 22:10 ` Eric W. Biederman [this message]
2006-08-07 23:55 ` Andrew Morton
2006-08-08 2:17 ` Andi Kleen
2006-08-08 2:41 ` Andrew Morton
2006-08-08 2:47 ` Arjan van de Ven
2006-08-08 5:47 ` [PATCH] x86_64: Auto size the per cpu area Eric W. Biederman
2006-08-08 6:01 ` Andrew Morton
2006-08-08 6:31 ` Eric W. Biederman
2006-08-08 6:01 ` Andi Kleen
2006-08-08 6:46 ` Eric W. Biederman
2006-08-08 6:48 ` Andi Kleen
2006-08-08 7:29 ` Eric W. Biederman
2006-08-08 5:09 ` [PATCH] x86_64: Make NR_IRQS configurable in Kconfig Paul Mackerras
2006-08-08 5:14 ` Andi Kleen
2006-08-08 8:17 ` Martin Schwidefsky
2006-08-09 17:58 ` Luck, Tony
2006-08-09 18:25 ` Dave Hansen
2006-08-10 12:55 ` Martin Schwidefsky
2006-08-10 14:40 ` Andy Whitcroft
2006-08-10 14:53 ` Martin Schwidefsky
2006-08-07 19:40 ` Adrian Bunk
2006-08-07 22:26 ` Eric W. Biederman
2006-08-07 23:06 ` Adrian Bunk
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=m1slk89ozd.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=Natalie.Protasevich@UNISYS.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
/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
Powered by JetHome