From 97679f9c091912ff9d5b7f3bda10c5b9ed331915 Mon Sep 17 00:00:00 2001
From: Andrew Morton <akpm@digeo.com>
Date: Thu, 31 Oct 2002 04:10:16 -0800
Subject: [PATCH] [PATCH] additional arch support for per-cpu kernel_stat

Companion to the previous patch: all the support needed for non-ia32
architectures.
---
 arch/alpha/kernel/irq.c                   |  4 ++--
 arch/alpha/kernel/irq_alpha.c             |  2 +-
 arch/arm/kernel/irq.c                     |  4 ++--
 arch/cris/kernel/irq.c                    |  4 ++--
 arch/ia64/kernel/irq.c                    |  4 ++--
 arch/m68k/amiga/amiints.c                 |  6 +++---
 arch/m68k/amiga/cia.c                     |  4 ++--
 arch/m68k/atari/ataints.c                 |  8 ++++----
 arch/m68k/kernel/ints.c                   |  4 ++--
 arch/m68k/mac/macints.c                   |  4 ++--
 arch/m68k/sun3/sun3ints.c                 | 15 ++++++++-------
 arch/mips/au1000/common/time.c            |  2 +-
 arch/mips/baget/irq.c                     |  4 ++--
 arch/mips/dec/irq.c                       |  4 ++--
 arch/mips/ite-boards/generic/irq.c        |  2 +-
 arch/mips/kernel/irq.c                    |  2 +-
 arch/mips/kernel/old-irq.c                |  6 +++---
 arch/mips/kernel/old-time.c               |  2 +-
 arch/mips/kernel/time.c                   |  2 +-
 arch/mips/mips-boards/atlas/atlas_int.c   |  4 ++--
 arch/mips/mips-boards/generic/time.c      |  2 +-
 arch/mips/philips/nino/irq.c              |  4 ++--
 arch/mips/sgi/kernel/indy_int.c           |  2 +-
 arch/mips/sgi/kernel/time.c               |  2 +-
 arch/mips64/mips-boards/atlas/atlas_int.c |  4 ++--
 arch/mips64/mips-boards/generic/time.c    |  2 +-
 arch/mips64/mips-boards/malta/malta_int.c |  6 +++---
 arch/mips64/sgi-ip22/ip22-int.c           | 12 ++++++------
 arch/mips64/sgi-ip22/ip22-timer.c         |  4 ++--
 arch/mips64/sgi-ip27/ip27-irq.c           |  4 ++--
 arch/mips64/sgi-ip27/ip27-timer.c         |  2 +-
 arch/parisc/kernel/irq.c                  |  2 +-
 arch/ppc/amiga/amiints.c                  |  4 ++--
 arch/ppc/amiga/cia.c                      |  2 +-
 arch/ppc/amiga/ints.c                     |  4 ++--
 arch/ppc/kernel/irq.c                     |  4 ++--
 arch/ppc64/kernel/irq.c                   |  4 ++--
 arch/sh/kernel/irq.c                      |  2 +-
 arch/sparc/kernel/irq.c                   |  6 +++---
 arch/sparc/kernel/sun4d_irq.c             |  4 ++--
 arch/sparc64/kernel/irq.c                 |  6 +++---
 arch/sparc64/kernel/smp.c                 |  2 +-
 arch/um/kernel/irq.c                      |  4 ++--
 arch/x86_64/kernel/irq.c                  |  4 ++--
 44 files changed, 90 insertions(+), 89 deletions(-)

diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 611a52d60188..b3b12b2bafa5 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -528,7 +528,7 @@ show_interrupts(struct seq_file *p, void *v)
 #else
 		for (j = 0; j < NR_CPUS; j++)
 			if (cpu_online(j))
-				seq_printf(p, "%10u ", kstat.irqs[j][i]);
+				seq_printf(p, "%10u ", kstat_cpu(i).irqs[j]);
 #endif
 		seq_printf(p, " %14s", irq_desc[i].handler->typename);
 		seq_printf(p, "  %c%s",
@@ -590,7 +590,7 @@ handle_irq(int irq, struct pt_regs * regs)
 	}
 
 	irq_enter();
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(i).irqs[irq]++;
 	spin_lock_irq(&desc->lock); /* mask also the higher prio events */
 	desc->handler->ack(irq);
 	/*
diff --git a/arch/alpha/kernel/irq_alpha.c b/arch/alpha/kernel/irq_alpha.c
index 476f17980249..84f7472c12e4 100644
--- a/arch/alpha/kernel/irq_alpha.c
+++ b/arch/alpha/kernel/irq_alpha.c
@@ -59,7 +59,7 @@ do_entInt(unsigned long type, unsigned long vector, unsigned long la_ptr,
 		smp_percpu_timer_interrupt(&regs);
 		cpu = smp_processor_id();
 		if (cpu != boot_cpuid) {
-		        kstat.irqs[cpu][RTC_IRQ]++;
+		        kstat_cpu(cpu).irqs[RTC_IRQ]++;
 		} else {
 			handle_irq(RTC_IRQ, &regs);
 		}
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 399d81bf412a..619e9875146f 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -217,7 +217,7 @@ do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
 
 	desc->triggered = 1;
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	action = desc->action;
 	if (action)
@@ -253,7 +253,7 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
 	 */
 	desc->running = 1;
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	do {
 		struct irqaction *action;
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index 9f4c92a2e906..ad724fe737a1 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -234,7 +234,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %10u %c %s",
-			i, kstat.irqs[0][i],
+			i, kstat_cpu(0).irqs[i],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action = action->next; action; action = action->next) {
@@ -261,7 +261,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
 
         cpu = smp_processor_id();
         irq_enter(cpu);
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	action = irq_action[irq];
         if (action) {
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index cde008c9c76b..a1fcd948efad 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -172,7 +172,7 @@ int show_interrupts(struct seq_file *p, void *v)
 #else
 		for (j = 0; j < NR_CPUS; j++)
 			if (cpu_online(j))
-				seq_printf(p, "%10u ", kstat.irqs[j][i]);
+				seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
 #endif
 		seq_printf(p, " %14s", idesc->handler->typename);
 		seq_printf(p, "  %s", action->name);
@@ -346,7 +346,7 @@ unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs)
 	unsigned int status;
 
 	irq_enter();
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	if (desc->status & IRQ_PER_CPU) {
 		/* no locking required for CPU-local interrupts: */
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c
index b6a01b2c05cb..e2f993797cd2 100644
--- a/arch/m68k/amiga/amiints.c
+++ b/arch/m68k/amiga/amiints.c
@@ -350,7 +350,7 @@ void amiga_disable_irq(unsigned int irq)
 
 inline void amiga_do_irq(int irq, struct pt_regs *fp)
 {
-	kstat.irqs[0][SYS_IRQS + irq]++;
+	kstat_cpu(0).irqs[SYS_IRQS + irq]++;
 	ami_irq_list[irq]->handler(irq, ami_irq_list[irq]->dev_id, fp);
 }
 
@@ -358,7 +358,7 @@ void amiga_do_irq_list(int irq, struct pt_regs *fp)
 {
 	irq_node_t *node;
 
-	kstat.irqs[0][SYS_IRQS + irq]++;
+	kstat_cpu(0).irqs[SYS_IRQS + irq]++;
 
 	custom.intreq = amiga_intena_vals[irq];
 
@@ -479,7 +479,7 @@ int show_amiga_interrupts(struct seq_file *p, void *v)
 		if (!(node = ami_irq_list[i]))
 			continue;
 		seq_printf(p, "ami  %2d: %10u ", i,
-		               kstat.irqs[0][SYS_IRQS + i]);
+		               kstat_cpu(0).irqs[SYS_IRQS + i]);
 		do {
 			if (node->flags & SA_INTERRUPT)
 				seq_puts(p, "F ");
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c
index 68abf6287118..bebb2d4b171c 100644
--- a/arch/m68k/amiga/cia.c
+++ b/arch/m68k/amiga/cia.c
@@ -131,7 +131,7 @@ static void cia_handler(int irq, void *dev_id, struct pt_regs *fp)
 	custom.intreq = base->int_mask;
 	for (i = 0; i < CIA_IRQS; i++, irq++, mach_irq++) {
 		if (ints & 1) {
-			kstat.irqs[0][irq]++;
+			kstat_cpu(0).irqs[irq]++;
 			base->irq_list[i].handler(mach_irq, base->irq_list[i].dev_id, fp);
 		}
 		ints >>= 1;
@@ -166,7 +166,7 @@ int cia_get_irq_list(struct ciabase *base, struct seq_file *p)
 	j = base->cia_irq;
 	for (i = 0; i < CIA_IRQS; i++) {
 		seq_printf(p, "cia  %2d: %10d ", j + i,
-			       kstat.irqs[0][SYS_IRQS + j + i]);
+			       kstat_cpu(0).irqs[SYS_IRQS + j + i]);
 		seq_puts(p, "  ");
 		seq_printf(p, "%s\n", base->irq_list[i].devname);
 	}
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index 5800a74cd04b..8e3676cbf377 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -191,7 +191,7 @@ __asm__ (__ALIGN_STR "\n"						   \
 "	andw	#0xfeff,%%sr\n"		/* set IPL = 6 again */		   \
 "	orb 	#(1<<(%c3&7)),%a4:w\n"	/* now unmask the int again */	   \
 "	jbra	ret_from_interrupt\n"					   \
-	 : : "i" (&kstat.irqs[0][n+8]), "i" (&irq_handler[n+8]),	   \
+	 : : "i" (&kstat_cpu(0).irqs[n+8]), "i" (&irq_handler[n+8]),	   \
 	     "n" (PT_OFF_SR), "n" (n),					   \
 	     "i" (n & 8 ? (n & 16 ? &tt_mfp.int_mk_a : &mfp.int_mk_a)	   \
 		        : (n & 16 ? &tt_mfp.int_mk_b : &mfp.int_mk_b)),	   \
@@ -297,7 +297,7 @@ atari_prio_irq_handler:\t
 	addql	#8,%%sp
 	addql	#4,%%sp
 	jbra	ret_from_interrupt"
-	 : : "i" (&kstat.irqs[0]), "n" (PT_OFF_FORMATVEC),
+	 : : "i" (&kstat_cpu(0).irqs), "n" (PT_OFF_FORMATVEC),
 	     "m" (local_irq_count(0))
 );
 	for (;;);
@@ -623,11 +623,11 @@ int show_atari_interrupts(struct seq_file *p, void *v)
 			continue;
 		if (i < STMFP_SOURCE_BASE)
 			seq_printf(p, "auto %2d: %10u ",
-				       i, kstat.irqs[0][i]);
+				       i, kstat_cpu(0).irqs[i]);
 		else
 			seq_printf(p, "vec $%02x: %10u ",
 				       IRQ_SOURCE_TO_VECTOR(i),
-				       kstat.irqs[0][i]);
+				       kstat_cpu(0).irqs[i]);
 
 		if (irq_handler[i].handler != atari_call_irq_list) {
 			seq_printf(p, "%s\n", irq_param[i].devname);
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index b69407501038..b3da5f4912d4 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -231,7 +231,7 @@ asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
 {
 	if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) {
 		vec -= VEC_SPUR;
-		kstat.irqs[0][vec]++;
+		kstat_cpu(0).irqs[vec]++;
 		irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
 	} else {
 		if (mach_process_int)
@@ -250,7 +250,7 @@ int show_interrupts(struct seq_file *p, void *v)
 	if (mach_default_handler) {
 		for (i = 0; i < SYS_IRQS; i++) {
 			seq_printf(p, "auto %2d: %10u ", i,
-			               i ? kstat.irqs[0][i] : num_spurious);
+			               i ? kstat_cpu(0).irqs[i] : num_spurious);
 			seq_puts(p, "  ");
 			seq_printf(p, "%s\n", irq_list[i].devname);
 		}
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index 75067a377a30..09f459508f11 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -345,7 +345,7 @@ void mac_do_irq_list(int irq, struct pt_regs *fp)
 	irq_node_t *node, *slow_nodes;
 	unsigned long cpu_flags;
 
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 
 #ifdef DEBUG_SPURIOUS
 	if (!mac_irq_list[irq] && (console_loglevel > 7)) {
@@ -620,7 +620,7 @@ int show_mac_interrupts(struct seq_file *p, void *v)
 			case 8: base = "bbn";
 				break;
 		}
-		seq_printf(p, "%4s %2d: %10u ", base, i, kstat.irqs[0][i]);
+		seq_printf(p, "%4s %2d: %10u ", base, i, kstat_cpu(0).irqs[i]);
 
 		do {
 			if (node->flags & IRQ_FLG_FAST) {
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c
index f4270ca8589e..c81842f461ee 100644
--- a/arch/m68k/sun3/sun3ints.c
+++ b/arch/m68k/sun3/sun3ints.c
@@ -58,7 +58,7 @@ void sun3_disable_irq(unsigned int irq)
 
 inline void sun3_do_irq(int irq, struct pt_regs *fp)
 {
-	kstat.irqs[0][SYS_IRQS + irq]++;
+	kstat_cpu(0).irqs[SYS_IRQS + irq]++;
 	*sun3_intreg &= ~(1<<irq);
 	*sun3_intreg |=  (1<<irq);
 }
@@ -71,13 +71,14 @@ int show_sun3_interrupts(struct seq_file *p, void *v)
 static void sun3_int7(int irq, void *dev_id, struct pt_regs *fp)
 {
 	sun3_do_irq(irq,fp);
-	if(!(kstat.irqs[0][SYS_IRQS + irq] % 2000)) 
-		sun3_leds(led_pattern[(kstat.irqs[0][SYS_IRQS+irq]%16000)/2000]);
+	if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 2000)) 
+		sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%16000)
+			  /2000]);
 }
 
 static void sun3_int5(int irq, void *dev_id, struct pt_regs *fp)
 {
-        kstat.irqs[0][SYS_IRQS + irq]++;
+        kstat_cpu(0).irqs[SYS_IRQS + irq]++;
 #ifdef CONFIG_SUN3
 	intersil_clear();
 #endif
@@ -87,8 +88,8 @@ static void sun3_int5(int irq, void *dev_id, struct pt_regs *fp)
 	intersil_clear();
 #endif
         do_timer(fp);
-        if(!(kstat.irqs[0][SYS_IRQS + irq] % 20))
-                sun3_leds(led_pattern[(kstat.irqs[0][SYS_IRQS+irq]%160)
+        if(!(kstat_cpu(0).irqs[SYS_IRQS + irq] % 20))
+                sun3_leds(led_pattern[(kstat_cpu(0).irqs[SYS_IRQS+irq]%160)
                 /20]);
 }
 
@@ -107,7 +108,7 @@ static void sun3_inthandle(int irq, void *dev_id, struct pt_regs *fp)
 	if(sun3_inthandler[irq] == NULL)
 		panic ("bad interrupt %d received (id %p)\n",irq, dev_id);
 
-        kstat.irqs[0][SYS_IRQS + irq]++;
+        kstat_cpu(0).irqs[SYS_IRQS + irq]++;
         *sun3_intreg &= ~(1<<irq);
 
 	sun3_inthandler[irq](irq, dev_ids[irq], fp);
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index fd52025abbda..e57c446769c2 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -68,7 +68,7 @@ void mips_timer_interrupt(struct pt_regs *regs)
 		goto null;
 
 	do {
-		kstat.irqs[0][irq]++;
+		kstat_cpu(0).irqs[irq]++;
 		do_timer(regs);
 		r4k_cur += r4k_offset;
 		ack_r4ktimer(r4k_cur);
diff --git a/arch/mips/baget/irq.c b/arch/mips/baget/irq.c
index 551985d5a9c2..9e7b33ae15a7 100644
--- a/arch/mips/baget/irq.c
+++ b/arch/mips/baget/irq.c
@@ -152,7 +152,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			i, kstat.irqs[0][i],
+			i, kstat_cpu(0).irqs[i],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -180,7 +180,7 @@ static void do_IRQ(int irq, struct pt_regs * regs)
 
 	cpu = smp_processor_id();
 	irq_enter(cpu, irq);
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	mask_irq(irq);  
 	action = *(irq + irq_action);
diff --git a/arch/mips/dec/irq.c b/arch/mips/dec/irq.c
index d34890f29dde..a256637191cb 100644
--- a/arch/mips/dec/irq.c
+++ b/arch/mips/dec/irq.c
@@ -103,7 +103,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action)
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-				i, kstat.irqs[0][i],
+				i, kstat_cpu(0).irqs[i],
 				(action->flags & SA_INTERRUPT) ? '+' : ' ',
 				action->name);
 		for (action = action->next; action; action = action->next) {
@@ -130,7 +130,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
 
     cpu = smp_processor_id();
     irq_enter(cpu, irq);
-    kstat.irqs[cpu][irq]++;
+    kstat_cpu(cpu).irqs[irq]++;
 
     mask_irq(irq);
     action = *(irq + irq_action);
diff --git a/arch/mips/ite-boards/generic/irq.c b/arch/mips/ite-boards/generic/irq.c
index 88003824768a..74298ffa826c 100644
--- a/arch/mips/ite-boards/generic/irq.c
+++ b/arch/mips/ite-boards/generic/irq.c
@@ -256,7 +256,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
 	cpu = smp_processor_id();
 	irq_enter(cpu, irq);
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 #if 0
 	if (irq_desc[irq].handler && irq_desc[irq].handler->ack) {
 	//	printk("invoking ack handler\n");
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index baa7000d9baf..446f28d33c7f 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -244,7 +244,7 @@ asmlinkage unsigned int do_IRQ(int irq, struct pt_regs *regs)
 	struct irqaction * action;
 	unsigned int status;
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	spin_lock(&desc->lock);
 	desc->handler->ack(irq);
 	/*
diff --git a/arch/mips/kernel/old-irq.c b/arch/mips/kernel/old-irq.c
index 664be080f40e..520caf6af078 100644
--- a/arch/mips/kernel/old-irq.c
+++ b/arch/mips/kernel/old-irq.c
@@ -134,7 +134,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			i, kstat.irqs[0][i],
+			i, kstat_cpu(0).irqs[i],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -176,7 +176,7 @@ asmlinkage void i8259_do_irq(int irq, struct pt_regs *regs)
 
 	i8259_mask_and_ack_irq(irq);
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	action = *(irq + irq_action);
 	if (!action)
@@ -214,7 +214,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
 
 	cpu = smp_processor_id();
 	irq_enter(cpu, irq);
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	action = *(irq + irq_action);
 	if (action) {
diff --git a/arch/mips/kernel/old-time.c b/arch/mips/kernel/old-time.c
index 8c31cd5bcb95..a58202bfae6f 100644
--- a/arch/mips/kernel/old-time.c
+++ b/arch/mips/kernel/old-time.c
@@ -424,7 +424,7 @@ r4k_timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 	 */
 	write_32bit_cp0_register (CP0_COMPARE, 
 				  (unsigned long) (count + r4k_interval));
-        kstat.irqs[0][irq]++;
+        kstat_cpu(0).irqs[irq]++;
 #endif
 
 	timer_interrupt(irq, dev_id, regs);
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index ba3f45656bc7..ed347b400ee6 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -369,7 +369,7 @@ asmlinkage void ll_timer_interrupt(int irq, struct pt_regs *regs)
 	int cpu = smp_processor_id();
 
 	irq_enter(cpu, irq);
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	/* we keep interrupt disabled all the time */
 	timer_interrupt(irq, NULL, regs);
diff --git a/arch/mips/mips-boards/atlas/atlas_int.c b/arch/mips/mips-boards/atlas/atlas_int.c
index c13cf568d7ee..b544f682df27 100644
--- a/arch/mips/mips-boards/atlas/atlas_int.c
+++ b/arch/mips/mips-boards/atlas/atlas_int.c
@@ -105,7 +105,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
+			num, kstat_cpu(0).irqs[num],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -202,7 +202,7 @@ void atlas_hw0_irqdispatch(struct pt_regs *regs)
 	}
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	action->handler(irq, action->dev_id, regs);
 	irq_exit(cpu, irq);
 
diff --git a/arch/mips/mips-boards/generic/time.c b/arch/mips/mips-boards/generic/time.c
index 5e4658bc5d47..73031a7668dd 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -139,7 +139,7 @@ void mips_timer_interrupt(struct pt_regs *regs)
 		goto null;
 
 	do {
-		kstat.irqs[0][irq]++;
+		kstat_cpu(0).irqs[irq]++;
 		do_timer(regs);
 
 		/* Historical comment/code:
diff --git a/arch/mips/philips/nino/irq.c b/arch/mips/philips/nino/irq.c
index 7bd0de00a9b5..80c51c6e3156 100644
--- a/arch/mips/philips/nino/irq.c
+++ b/arch/mips/philips/nino/irq.c
@@ -125,7 +125,7 @@ int show_interrupts(struct seq_file *p, void *v)
 	if (!action)
 	    continue;
 	seq_printf(p, "%2d: %8d %c %s",
-		       i, kstat.irqs[0][i],
+		       i, kstat_cpu(0).irqs[i],
 		       (action->flags & SA_INTERRUPT) ? '+' : ' ',
 		       action->name);
 	for (action = action->next; action; action = action->next) {
@@ -161,7 +161,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
 
     cpu = smp_processor_id();
     irq_enter(cpu, irq);
-    kstat.irqs[cpu][irq]++;
+    kstat_cpu(0).irqs[irq]++;
 
     if (irq == 20) {
             printk("20 %08lx %08lx\n   %08lx %08lx\n   %08lx\n",
diff --git a/arch/mips/sgi/kernel/indy_int.c b/arch/mips/sgi/kernel/indy_int.c
index 9dadaceec412..8b9202f81ed0 100644
--- a/arch/mips/sgi/kernel/indy_int.c
+++ b/arch/mips/sgi/kernel/indy_int.c
@@ -418,7 +418,7 @@ void indy_buserror_irq(struct pt_regs *regs)
 	int irq = 6;
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	printk("Got a bus error IRQ, shouldn't happen yet\n");
 	show_regs(regs);
 	printk("Spinning...\n");
diff --git a/arch/mips/sgi/kernel/time.c b/arch/mips/sgi/kernel/time.c
index a0f4d3de8aa6..33dde66ff876 100644
--- a/arch/mips/sgi/kernel/time.c
+++ b/arch/mips/sgi/kernel/time.c
@@ -13,7 +13,7 @@ void indy_8254timer_irq(void)
 	int irq = 4;
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	printk("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
 	prom_getchar();
 	ArcEnterInteractiveMode();
diff --git a/arch/mips64/mips-boards/atlas/atlas_int.c b/arch/mips64/mips-boards/atlas/atlas_int.c
index 667c2bdd4c24..33e48b5c40c4 100644
--- a/arch/mips64/mips-boards/atlas/atlas_int.c
+++ b/arch/mips64/mips-boards/atlas/atlas_int.c
@@ -101,7 +101,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
+			num, kstat_cpu(0).irqs[num],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -198,7 +198,7 @@ void atlas_hw0_irqdispatch(struct pt_regs *regs)
 	}
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	action->handler(irq, action->dev_id, regs);
 	irq_exit(cpu, irq);
 
diff --git a/arch/mips64/mips-boards/generic/time.c b/arch/mips64/mips-boards/generic/time.c
index b10c65aaa7a7..ed1f105c090d 100644
--- a/arch/mips64/mips-boards/generic/time.c
+++ b/arch/mips64/mips-boards/generic/time.c
@@ -138,7 +138,7 @@ void mips_timer_interrupt(struct pt_regs *regs)
 		goto null;
 
 	do {
-		kstat.irqs[0][irq]++;
+		kstat_cpu(0).irqs[irq]++;
 		do_timer(regs);
 
 		/* Historical comment/code:
diff --git a/arch/mips64/mips-boards/malta/malta_int.c b/arch/mips64/mips-boards/malta/malta_int.c
index d58af8391a53..daafc16af6f6 100644
--- a/arch/mips64/mips-boards/malta/malta_int.c
+++ b/arch/mips64/mips-boards/malta/malta_int.c
@@ -131,7 +131,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
+			num, kstat_cpu(0).irqs[num],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -146,7 +146,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
+			num, kstat_cpu(0).irqs[num],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -322,7 +322,7 @@ void malta_hw0_irqdispatch(struct pt_regs *regs)
 		return;
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq + 8]++;
+	kstat_cpu(0).irqs[irq + 8]++;
 	do {
 	        action->handler(irq, action->dev_id, regs);
 		action = action->next;
diff --git a/arch/mips64/sgi-ip22/ip22-int.c b/arch/mips64/sgi-ip22/ip22-int.c
index dcc328ab7dfc..316460cd4359 100644
--- a/arch/mips64/sgi-ip22/ip22-int.c
+++ b/arch/mips64/sgi-ip22/ip22-int.c
@@ -243,7 +243,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
+			num, kstat_cpu(0).irqs[num],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -258,7 +258,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		if (!action) 
 			continue;
 		seq_printf(p, "%2d: %8d %c %s",
-			num, kstat.irqs[0][num],
+			num, kstat_cpu(0).irqs[num],
 			(action->flags & SA_INTERRUPT) ? '+' : ' ',
 			action->name);
 		for (action=action->next; action; action = action->next) {
@@ -285,7 +285,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
 
 	cpu = smp_processor_id();
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 
 	panic(KERN_DEBUG "Got irq %d, press a key.", irq);
 
@@ -444,7 +444,7 @@ void indy_local0_irqdispatch(struct pt_regs *regs)
 	}
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq + 16]++;
+	kstat_cpu(0).irqs[irq + 16]++;
 	action->handler(irq, action->dev_id, regs);
 	irq_exit(cpu, irq);
 }
@@ -468,7 +468,7 @@ void indy_local1_irqdispatch(struct pt_regs *regs)
 		action = local_irq_action[irq];
 	}
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq + 24]++;
+	kstat_cpu(0).irqs[irq + 24]++;
 	action->handler(irq, action->dev_id, regs);
 	irq_exit(cpu, irq);
 }
@@ -479,7 +479,7 @@ void indy_buserror_irq(struct pt_regs *regs)
 	int irq = 6;
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	printk("Got a bus error IRQ, shouldn't happen yet\n");
 	show_regs(regs);
 	printk("Spinning...\n");
diff --git a/arch/mips64/sgi-ip22/ip22-timer.c b/arch/mips64/sgi-ip22/ip22-timer.c
index 9ffc5dad1709..e7a80c90b480 100644
--- a/arch/mips64/sgi-ip22/ip22-timer.c
+++ b/arch/mips64/sgi-ip22/ip22-timer.c
@@ -98,7 +98,7 @@ void indy_timer_interrupt(struct pt_regs *regs)
         else
             r4k_cur += r4k_offset;
 	ack_r4ktimer(r4k_cur);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	do_timer(regs);
 
 	/* We update the Dallas time of day approx. every 11 minutes,
@@ -236,7 +236,7 @@ void indy_8254timer_irq(void)
 	int irq = 4;
 
 	irq_enter(cpu, irq);
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	panic("indy_8254timer_irq: Whoops, should not have gotten this IRQ\n");
 	irq_exit(cpu, irq);
 }
diff --git a/arch/mips64/sgi-ip27/ip27-irq.c b/arch/mips64/sgi-ip27/ip27-irq.c
index aa423e31ec6a..ccccd7ce1563 100644
--- a/arch/mips64/sgi-ip27/ip27-irq.c
+++ b/arch/mips64/sgi-ip27/ip27-irq.c
@@ -146,7 +146,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		action = irq_action[i];
 		if (!action) 
 			continue;
-		seq_printf(p, "%2d: %8d %c %s", i, kstat.irqs[0][i],
+		seq_printf(p, "%2d: %8d %c %s", i, kstat_cpu(0).irqs[i],
 		               (action->flags & SA_INTERRUPT) ? '+' : ' ',
 		               action->name);
 		for (action=action->next; action; action = action->next) {
@@ -170,7 +170,7 @@ static void do_IRQ(cpuid_t thiscpu, int irq, struct pt_regs * regs)
 	int do_random;
 
 	irq_enter(thiscpu, irq);
-	kstat.irqs[thiscpu][irq]++;
+	kstat_cpu(thiscpu).irqs[irq]++;
 
 	action = *(irq + irq_action);
 	if (action) {
diff --git a/arch/mips64/sgi-ip27/ip27-timer.c b/arch/mips64/sgi-ip27/ip27-timer.c
index 8b4c5bae2012..e0251cd0d379 100644
--- a/arch/mips64/sgi-ip27/ip27-timer.c
+++ b/arch/mips64/sgi-ip27/ip27-timer.c
@@ -103,7 +103,7 @@ void rt_timer_interrupt(struct pt_regs *regs)
 	if (LOCAL_HUB_L(PI_RT_COUNT) >= ct_cur[cpu])
 		goto again;
 
-	kstat.irqs[cpu][irq]++;		/* kstat only for bootcpu? */
+	kstat_cpu(cpu).irqs[irq]++;		/* kstat only for bootcpu? */
 
 	if (cpu == 0)
 		do_timer(regs);
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index c8ef298bde2b..575b0a366333 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -232,7 +232,7 @@ int show_interrupts(struct seq_file *p, void *v)
 #else
 		for (j = 0; j < smp_num_cpus; j++)
 		    seq_printf(p, "%10u ",
-			    kstat.irqs[cpu_logical_map(j)][irq_no]);
+			    kstat_cpu(cpu_logical_map(j)).irqs[irq_no]);
 #endif
 		seq_printf(p, " %14s",
 			    region->data.name ? region->data.name : "N/A");
diff --git a/arch/ppc/amiga/amiints.c b/arch/ppc/amiga/amiints.c
index f2dfb7bb3884..73b772518e2f 100644
--- a/arch/ppc/amiga/amiints.c
+++ b/arch/ppc/amiga/amiints.c
@@ -189,7 +189,7 @@ inline void amiga_do_irq(int irq, struct pt_regs *fp)
 	irq_desc_t *desc = irq_desc + irq;
 	struct irqaction *action = desc->action;
 
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 	action->handler(irq, action->dev_id, fp);
 }
 
@@ -198,7 +198,7 @@ void amiga_do_irq_list(int irq, struct pt_regs *fp)
 	irq_desc_t *desc = irq_desc + irq;
 	struct irqaction *action;
 
-	kstat.irqs[0][irq]++;
+	kstat_cpu(0).irqs[irq]++;
 
 	custom.intreq = ami_intena_vals[irq];
 
diff --git a/arch/ppc/amiga/cia.c b/arch/ppc/amiga/cia.c
index c8f20e92d758..ad961465b6cb 100644
--- a/arch/ppc/amiga/cia.c
+++ b/arch/ppc/amiga/cia.c
@@ -148,7 +148,7 @@ static void cia_handler(int irq, void *dev_id, struct pt_regs *fp)
 	custom.intreq = base->int_mask;
 	for (i = 0; i < CIA_IRQS; i++, irq++) {
 		if (ints & 1) {
-			kstat.irqs[0][irq]++;
+			kstat_cpu(0).irqs[irq]++;
 			action = desc->action;
 			action->handler(irq, action->dev_id, fp);
 		}
diff --git a/arch/ppc/amiga/ints.c b/arch/ppc/amiga/ints.c
index c47c57f30013..d339b8839510 100644
--- a/arch/ppc/amiga/ints.c
+++ b/arch/ppc/amiga/ints.c
@@ -130,7 +130,7 @@ asmlinkage void process_int(unsigned long vec, struct pt_regs *fp)
 {
 	if (vec >= VEC_INT1 && vec <= VEC_INT7 && !MACH_IS_BVME6000) {
 		vec -= VEC_SPUR;
-		kstat.irqs[0][vec]++;
+		kstat_cpu(0).irqs[vec]++;
 		irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
 	} else {
 		if (mach_process_int)
@@ -149,7 +149,7 @@ int m68k_get_irq_list(struct seq_file *p, void *v)
 	if (mach_default_handler) {
 		for (i = 0; i < SYS_IRQS; i++) {
 			seq_printf(p, "auto %2d: %10u ", i,
-			               i ? kstat.irqs[0][i] : num_spurious);
+			               i ? kstat_cpu(0).irqs[i] : num_spurious);
 			seq_puts(p, "  ");
 			seq_printf(p, "%s\n", irq_list[i].devname);
 		}
diff --git a/arch/ppc/kernel/irq.c b/arch/ppc/kernel/irq.c
index 90f0c619d410..e7e0edc3e26a 100644
--- a/arch/ppc/kernel/irq.c
+++ b/arch/ppc/kernel/irq.c
@@ -362,7 +362,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		for (j = 0; j < NR_CPUS; j++)
 			if (cpu_online(j))
 				seq_printf(p, "%10u ",
-					   kstat.irqs[j][i]);
+					   kstat_cpu(j).irqs[i]);
 #else		
 		seq_printf(p, "%10u ", kstat_irqs(i));
 #endif /* CONFIG_SMP */
@@ -423,7 +423,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
 	int cpu = smp_processor_id();
 	irq_desc_t *desc = irq_desc + irq;
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	spin_lock(&desc->lock);
 	ack_irq(irq);	
 	/*
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index bb99b05403df..ec27ced1df88 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -357,7 +357,7 @@ int show_interrupts(struct seq_file *p, void *v)
 #ifdef CONFIG_SMP
 		for (j = 0; j < NR_CPUS; j++) {
 			if (cpu_online(j))
-				seq_printf(p, "%10u ", kstat.irqs[j][i]);
+				seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
 		}
 #else		
 		seq_printf(p, "%10u ", kstat_irqs(i));
@@ -484,7 +484,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
 	if (naca->interrupt_controller == IC_OPEN_PIC)
 		balance_irq(irq);
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	spin_lock(&desc->lock);
 	ack_irq(irq);	
 	/*
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 32e86b0bab0e..e44a5e5cf68b 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -239,7 +239,7 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5,
 		     :"=z" (irq));
 	irq = irq_demux(irq);
 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	desc = irq_desc + irq;
 	spin_lock(&desc->lock);
 	desc->handler->ack(irq);
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 811080b01e90..d09f16f51a51 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -124,7 +124,7 @@ int show_interrupts(struct seq_file *p, void *v)
 		for (j = 0; j < NR_CPUS; j++) {
 			if (cpu_online(j))
 				seq_printf(p, "%10u ",
-				    kstat.irqs[cpu_logical_map(j)][i]);
+				    kstat_cpu(cpu_logical_map(j)).irqs[i]);
 		}
 #endif
 		seq_printf(p, " %c %s",
@@ -424,7 +424,7 @@ void handler_irq(int irq, struct pt_regs * regs)
 		smp4m_irq_rotate(cpu);
 #endif
 	action = *(irq + irq_action);
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	do {
 		if (!action || !action->handler)
 			unexpected_irq(irq, 0, regs);
@@ -444,7 +444,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
 
 	disable_pil_irq(irq);
 	irq_enter();
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	floppy_interrupt(irq, dev_id, regs);
 	irq_exit();
 	enable_pil_irq(irq);
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index e399e0f5d3f3..a23291d1c905 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -102,7 +102,7 @@ found_it:	seq_printf(p, "%3d: ", i);
 		for (x = 0; x < NR_CPUS; x++) {
 			if (cpu_online)
 				seq_printf(p, "%10u ",
-				       kstat.irqs[cpu_logical_map(x)][i]);
+				       kstat_cpu(cpu_logical_map(x)).irqs[i]);
 		}
 #endif
 		seq_printf(p, "%c %s",
@@ -199,7 +199,7 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs)
 	cc_set_iclr(1 << irq);
 	
 	irq_enter();
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	if (!sbusl) {
 		action = *(irq + irq_action);
 		if (!action)
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index c9f1df477fe0..fb3512af435e 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -135,7 +135,7 @@ int show_interrupts(struct seq_file *p, void *v)
 			if (!cpu_online(j))
 				continue;
 			seq_printf(p, "%10u ",
-				   kstat.irqs[j][i]);
+				   kstat_cpu(j).irqs[i]);
 		}
 #endif
 		seq_printf(p, " %s:%lx", action->name,
@@ -738,7 +738,7 @@ void handler_irq(int irq, struct pt_regs *regs)
 #endif
 
 	irq_enter();
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	if (irq == 9)
 		kbd_pt_regs = regs;
@@ -813,7 +813,7 @@ void sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
 	int cpu = smp_processor_id();
 
 	irq_enter();
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 
 	*(irq_work(cpu, irq)) = 0;
 	bucket = get_ino_in_irqaction(action) + ivector_table;
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 4600944cd59b..d5c544b6bc4b 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -967,7 +967,7 @@ void smp_percpu_timer_interrupt(struct pt_regs *regs)
 			if (cpu == boot_cpu_id) {
 				irq_enter();
 
-				kstat.irqs[cpu][0]++;
+				kstat_cpu(cpu).irqs[0]++;
 				timer_tick_interrupt(regs);
 
 				irq_exit();
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 56454f28f03b..45fabd1e471e 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -108,7 +108,7 @@ int get_irq_list(char *buf)
 #else
 		for (j = 0; j < num_online_cpus(); j++)
 			p += sprintf(p, "%10u ",
-				kstat.irqs[cpu_logical_map(j)][i]);
+				kstat_cpu(cpu_logical_map(j)).irqs[i]);
 #endif
 		p += sprintf(p, " %14s", irq_desc[i].handler->typename);
 		p += sprintf(p, "  %s", action->name);
@@ -283,7 +283,7 @@ unsigned int do_IRQ(int irq, struct uml_pt_regs *regs)
 	unsigned int status;
 
 	irq_enter();
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	spin_lock(&desc->lock);
 	desc->handler->ack(irq);
 	/*
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index 09bce8011b82..430e903af5e1 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -151,7 +151,7 @@ int show_interrupts(struct seq_file *p, void *v)
 #else
 		for_each_cpu(j) 
 			seq_printf(p, "%10u ",
-				kstat.irqs[j][i]);
+				kstat_cpu(j).irqs[i]);
 #endif
 		seq_printf(p, " %14s", irq_desc[i].handler->typename);
 		seq_printf(p, "  %s", action->name);
@@ -328,7 +328,7 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
 	if (irq > 256) BUG();
 
 	irq_enter(); 
-	kstat.irqs[cpu][irq]++;
+	kstat_cpu(cpu).irqs[irq]++;
 	spin_lock(&desc->lock);
 	desc->handler->ack(irq);
 	/*
-- 
2.30.9