x86: use nr_cpus in max_nr_irqs()
PATCH 1/1 x86: use nr_cpus in max_nr_irqs()
Impact: get more small nr_irqs
Signed-off-by Yinghai Lu <[email protected]>
--- arch/x86/include/asm/apicdef.h | 7 +------ arch/x86/include/asm/irq_vectors.h | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-)
arch/x86/include/asm/irq_vectors.h +2 -2
@@ -122,8 +122,8 @@/* defined as a macro so nr_irqs = max_nr_irqs(nr_cpu_ids) can be used */ # define max_nr_irqs (nr_cpus) \ - ((8 * nr_cpus) > (32 * MAX_IO_APICS) ? \ - (NR_VECTORS + (8 * NR_CPUS)) : \ + ((8 * (nr_cpus)) > (32 * MAX_IO_APICS) ? \ + (NR_VECTORS + (8 * (nr_cpus)) : \ (NR_VECTORS + (32 * MAX_IO_APICS))) \# define NR_IRQS max_nr_irqs(NR_CPUS)
Quoted 14 lines · Yinghai Lu
Impact: get more small
nr_irqsSigned-off-by Yinghai Lu <[email protected]>--- arch/x86/include/asm/apicdef.h | 7 +------ arch/x86/include/asm/irq_vectors.h | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-)Index:
linux-2.6/arch/x86/include/asm/irq_vectors.h
===================================================================
arch/x86/include/asm/irq_vectors.h line 129
Quoted 10 lines
arch/x86/include/asm/irq_vectors.h +2
-2@@ -122,8 +122,8 @@/* defined as a macro so nr_irqs = max_nr_irqs(nr_cpu_ids) can be used */ # define max_nr_irqs (nr_cpus) \ - ((8 * nr_cpus) > (32 * MAX_IO_APICS) ? \ - (NR_VECTORS + (8 * NR_CPUS)) : \ + ((8 * (nr_cpus)) > (32 * MAX_IO_APICS) ? \ + (NR_VECTORS + (8 * (nr_cpus)) : \ (NR_VECTORS + (32 * MAX_IO_APICS))) \# define NR_IRQS max_nr_irqs(NR_CPUS)
Did I really miss that? I guess the reduction from 33024 to 4352 was sufficient for me... ;-)
Hey, a question... Can I determine what the maximum apic id would be? Right now it's fixed at 32k but that seems high even for 4096 cpus? (MAX_APICS].
Thanks!
Mike