diff options
author | Yinghai Lu <yinghai@kernel.org> | 2008-12-05 21:58:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-08 08:31:51 -0500 |
commit | 0b8f1efad30bd58f89961b82dfe68b9edf8fd2ac (patch) | |
tree | 239251bad791fd60af8c0f2ba365b7188395c83f /include/linux/irqnr.h | |
parent | 218d11a8b071b23b76c484fd5f72a4fe3306801e (diff) |
sparse irq_desc[] array: core kernel and x86 changes
Impact: new feature
Problem on distro kernels: irq_desc[NR_IRQS] takes megabytes of RAM with
NR_CPUS set to large values. The goal is to be able to scale up to much
larger NR_IRQS value without impacting the (important) common case.
To solve this, we generalize irq_desc[NR_IRQS] to an (optional) array of
irq_desc pointers.
When CONFIG_SPARSE_IRQ=y is used, we use kzalloc_node to get irq_desc,
this also makes the IRQ descriptors NUMA-local (to the site that calls
request_irq()).
This gets rid of the irq_cfg[] static array on x86 as well: irq_cfg now
uses desc->chip_data for x86 to store irq_cfg.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/irqnr.h')
-rw-r--r-- | include/linux/irqnr.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index 452c280c8115..7a299e989f8b 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
@@ -7,18 +7,10 @@ | |||
7 | 7 | ||
8 | # define for_each_irq_desc(irq, desc) \ | 8 | # define for_each_irq_desc(irq, desc) \ |
9 | for (irq = 0; irq < nr_irqs; irq++) | 9 | for (irq = 0; irq < nr_irqs; irq++) |
10 | #else | ||
11 | extern int nr_irqs; | ||
12 | 10 | ||
13 | # define for_each_irq_desc(irq, desc) \ | 11 | static inline early_sparse_irq_init(void) |
14 | for (irq = 0, desc = irq_desc; irq < nr_irqs; irq++, desc++) | 12 | { |
15 | 13 | } | |
16 | # define for_each_irq_desc_reverse(irq, desc) \ | ||
17 | for (irq = nr_irqs - 1, desc = irq_desc + (nr_irqs - 1); \ | ||
18 | irq >= 0; irq--, desc--) | ||
19 | #endif | 14 | #endif |
20 | 15 | ||
21 | #define for_each_irq_nr(irq) \ | ||
22 | for (irq = 0; irq < nr_irqs; irq++) | ||
23 | |||
24 | #endif | 16 | #endif |