2.4.19-pre8 apic_timer_irqs cacheline bouncing
PATCH 1/1 2.4.19-pre8 apic_timer_irqs cacheline bouncing
Hi Marcelo,
The following patch extirpates cacheline bouncing due to apic_timer_irqs[NR_CPUS] array, by placing them in the irq_stat[] cacheline aligned array for i386; irq_stat seemed like a good place for apic_timer_irqs.
This patch has been tested on a 4 way PIII xeon. The ia64 part is probably dead code lying around to make irq.c platform independent in the future. Please consider for 2.4.19*
Kiran
arch/i386/kernel/apic.c +1 -2
@@ -1055,7 +1055,6 @@* [ if a single-CPU system runs an SMP kernel then we call the local * interrupt as well. Thus we cannot inline the local irq ... ] */ -unsigned int apic_timer_irqs [NR_CPUS ];void smp_apic_timer_interrupt (struct pt_regs * regs) {
@@ -1064,7 +1063,7 @@/* * the NMI deadlock-detector uses this. */ - apic_timer_irqs[cpu]++; + irq_stat[cpu].apic_timer_irqs++;/* * NOTE! We'd better ACK the irq immediately,
arch/i386/kernel/irq.c +1 -1
@@ -170,7 +170,7 @@ p +=sprintf (p,"LOC: " );for (j =0 ; j < smp_num_cpus; j++) p +=sprintf (p,"%10u " , - apic_timer_irqs[cpu_logical_map (j)]); + irq_stat[cpu_logical_map (j)].apic_timer_irqs); p +=sprintf (p,"\n" );#endif p +=sprintf (p,"ERR: %10u\n" ,atomic_read (&irq_err_count));
arch/i386/kernel/nmi.c +1 -1
@@ -343,7 +343,7 @@*/ int sum, cpu =smp_processor_id (); - sum = apic_timer_irqs[cpu]; + sum = irq_stat[cpu].apic_timer_irqs;if (last_irq_sums[cpu] == sum) {/*
arch/ia64/kernel/irq.c +1 -1
@@ -172,7 +172,7 @@ p +=sprintf (p,"LOC: " );for (j =0 ; j < smp_num_cpus; j++) p +=sprintf (p,"%10u " , - apic_timer_irqs[cpu_logical_map (j)]); + irq_stat[cpu_logical_map (j)].apic_timer_irqs); p +=sprintf (p,"\n" );#endif p +=sprintf (p,"ERR: %10u\n" ,atomic_read (&irq_err_count));
include/asm-i386/apic.h +0 -1
@@ -85,7 +85,6 @@extern struct pm_dev *apic_pm_register (pm_dev_t ,unsigned long ,pm_callback );extern void apic_pm_unregister (struct pm_dev *); -extern unsigned int apic_timer_irqs [NR_CPUS ];extern int check_nmi_watchdog (void );extern unsigned int nmi_watchdog;
include/asm-i386/hardirq.h +3 -0
@@ -13,6 +13,9 @@unsigned int __syscall_count;struct task_struct * __ksoftirqd_task;/* waitqueue is too large */ unsigned int __nmi_count;/* arch dependent */ +#if CONFIG_X86_LOCAL_APIC +unsigned int apic_timer_irqs;/* arch dependent */ +#endif }____cacheline_aligned irq_cpustat_t;#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
kernel/softirq.c +1 -1
@@ -40,7 +40,7 @@- Bottom halves: globally serialized, grr... */ -irq_cpustat_t irq_stat[NR_CPUS ]; +irq_cpustat_t irq_stat[NR_CPUS ]____cacheline_aligned ; static struct softirq_action softirq_vec[32] __cacheline_aligned;