Name: Remove softirq_pending. Author: Rusty Russell Status: Tested on 2.6.10-rc2-bk13 Every user of softirq_pending(cpu) could be using local_softirq_pending, since it only really makes sense to ask about your own softirq state (and that's what every user does). This also makes the future per-cpu-ification of the irq_cpustat_t more efficient. Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-sparc64/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-sparc64/hardirq.h 2004-11-16 15:30:06.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-sparc64/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -24,7 +24,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-mips/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-mips/hardirq.h 2004-11-16 15:30:03.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-mips/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -35,7 +35,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-ia64/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-ia64/hardirq.h 2004-11-30 12:45:21.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-ia64/hardirq.h 2004-12-01 16:10:55.071059696 +1100 @@ -19,7 +19,6 @@ #define __ARCH_IRQ_STAT 1 -#define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending) #define local_softirq_pending() (local_cpu_data->softirq_pending) #define HARDIRQ_BITS 14 Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-arm26/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-arm26/hardirq.h 2004-11-16 15:29:59.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-arm26/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -32,7 +32,7 @@ #define irq_exit() \ do { \ preempt_count() -= HARDIRQ_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ __asm__("bl%? __do_softirq": : : "lr");/* out of line */\ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-h8300/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-h8300/hardirq.h 2004-11-16 15:29:59.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-h8300/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -30,7 +30,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-arm26/irqchip.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-arm26/irqchip.h 2003-09-22 10:09:07.000000000 +1000 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-arm26/irqchip.h 2004-12-01 15:42:08.000000000 +1100 @@ -97,7 +97,7 @@ desc->handle(irq, desc, regs); spin_unlock(&irq_controller_lock); - if (softirq_pending(smp_processor_id())) + if (local_softirq_pending()) do_softirq(); } #endif Index: linux-2.6.10-rc2-bk13-Percpu/include/linux/irq_cpustat.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/linux/irq_cpustat.h 2004-02-18 23:54:34.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/linux/irq_cpustat.h 2004-12-01 15:42:08.000000000 +1100 @@ -23,8 +23,7 @@ #endif /* arch independent irq_stat fields */ -#define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending) -#define local_softirq_pending() softirq_pending(smp_processor_id()) +#define local_softirq_pending() __IRQ_STAT(smp_processor_id(), __softirq_pending) /* arch dependent irq_stat fields */ #define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386 */ Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-m68knommu/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-m68knommu/hardirq.h 2004-11-16 15:30:03.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-m68knommu/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -28,7 +28,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-v850/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-v850/hardirq.h 2004-11-16 15:30:06.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-v850/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -28,7 +28,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-parisc/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-parisc/hardirq.h 2004-11-16 15:30:03.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-parisc/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -42,7 +42,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending())) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-m68k/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-m68k/hardirq.h 2004-11-16 15:30:03.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-m68k/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -27,7 +27,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/net/core/dev.c =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/net/core/dev.c 2004-11-30 12:45:23.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/net/core/dev.c 2004-12-01 16:10:55.091056656 +1100 @@ -1493,7 +1493,7 @@ preempt_disable(); err = netif_rx(skb); - if (softirq_pending(smp_processor_id())) + if (local_softirq_pending()) do_softirq(); preempt_enable(); Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-alpha/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-alpha/hardirq.h 2004-11-16 15:29:58.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-alpha/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -34,7 +34,7 @@ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ if (!in_interrupt() && \ - softirq_pending(smp_processor_id())) \ + local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-sparc/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-sparc/hardirq.h 2004-11-16 15:30:06.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-sparc/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -25,7 +25,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-sh/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-sh/hardirq.h 2004-11-16 15:30:05.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-sh/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -30,7 +30,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0) Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-s390/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-s390/hardirq.h 2004-11-16 15:30:05.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-s390/hardirq.h 2004-12-01 16:10:55.090056808 +1100 @@ -27,15 +27,6 @@ #define local_softirq_pending() (S390_lowcore.softirq_pending) -/* this is always called with cpu == smp_processor_id() at the moment */ -static inline __u32 -softirq_pending(unsigned int cpu) -{ - if (cpu == smp_processor_id()) - return local_softirq_pending(); - return lowcore_ptr[cpu]->softirq_pending; -} - #define __ARCH_IRQ_STAT #define HARDIRQ_BITS 8 Index: linux-2.6.10-rc2-bk13-Percpu/arch/cris/kernel/irq.c =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/arch/cris/kernel/irq.c 2004-11-16 15:29:02.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/arch/cris/kernel/irq.c 2004-12-01 15:42:08.000000000 +1100 @@ -159,7 +159,7 @@ } irq_exit(); - if (softirq_pending(cpu)) + if (local_softirq_pending()) do_softirq(); /* unmasking and bottom half handling is done magically for us. */ Index: linux-2.6.10-rc2-bk13-Percpu/include/asm-cris/hardirq.h =================================================================== --- linux-2.6.10-rc2-bk13-Percpu.orig/include/asm-cris/hardirq.h 2004-11-16 15:29:59.000000000 +1100 +++ linux-2.6.10-rc2-bk13-Percpu/include/asm-cris/hardirq.h 2004-12-01 15:42:08.000000000 +1100 @@ -32,7 +32,7 @@ #define irq_exit() \ do { \ preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && softirq_pending(smp_processor_id())) \ + if (!in_interrupt() && local_softirq_pending()) \ do_softirq(); \ preempt_enable_no_resched(); \ } while (0)