]> git.hungrycats.org Git - linux/commitdiff
[SOFTIRQ]: Define local_softirq_pending, use it in softirq.c
authorDavid S. Miller <davem@nuts.ninka.net>
Mon, 31 Mar 2003 07:23:31 +0000 (23:23 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Mon, 31 Mar 2003 07:23:31 +0000 (23:23 -0800)
Platforms, such as IA64, have a per-cpu mapping for local cpu
data.  When we killed off asm/softirq.h, we removed the usage
of local_softirq_pending IA64 was using.  By defining a generic
version we can put the optimization back.

include/linux/irq_cpustat.h
kernel/softirq.c

index 6eab29be1d611fd644193de3258b97c3e675bf4b..a83926f8294f2101fcef22decfca384e81affa6d 100644 (file)
@@ -29,6 +29,7 @@ extern irq_cpustat_t irq_stat[];                      /* defined in asm/hardirq.h */
 
   /* arch independent irq_stat fields */
 #define softirq_pending(cpu)   __IRQ_STAT((cpu), __softirq_pending)
+#define local_softirq_pending()        softirq_pending(smp_processor_id())
 #define syscall_count(cpu)     __IRQ_STAT((cpu), __syscall_count)
 #define ksoftirqd_task(cpu)    __IRQ_STAT((cpu), __ksoftirqd_task)
   /* arch dependent irq_stat fields */
index 77ee098739e15361b4ecc0c405b63c7aa9922283..53ef1cb8db9641476e61bf5cba37162ee2210c37 100644 (file)
@@ -56,15 +56,13 @@ asmlinkage void do_softirq()
        __u32 pending;
        unsigned long flags;
        __u32 mask;
-       int cpu;
 
        if (in_interrupt())
                return;
 
        local_irq_save(flags);
-       cpu = smp_processor_id();
 
-       pending = softirq_pending(cpu);
+       pending = local_softirq_pending();
 
        if (pending) {
                struct softirq_action *h;
@@ -73,7 +71,7 @@ asmlinkage void do_softirq()
                local_bh_disable();
 restart:
                /* Reset the pending bitmask before enabling irqs */
-               softirq_pending(cpu) = 0;
+               local_softirq_pending() = 0;
 
                local_irq_enable();
 
@@ -88,13 +86,13 @@ restart:
 
                local_irq_disable();
 
-               pending = softirq_pending(cpu);
+               pending = local_softirq_pending();
                if (pending & mask) {
                        mask &= ~pending;
                        goto restart;
                }
                if (pending)
-                       wakeup_softirqd(cpu);
+                       wakeup_softirqd(smp_processor_id());
                __local_bh_enable();
        }
 
@@ -106,7 +104,7 @@ void local_bh_enable(void)
        __local_bh_enable();
        BUG_ON(irqs_disabled());
        if (unlikely(!in_interrupt() &&
-                    softirq_pending(smp_processor_id())))
+                    local_softirq_pending()))
                do_softirq();
        preempt_check_resched();
 }
@@ -326,12 +324,12 @@ static int ksoftirqd(void * __bind_cpu)
        ksoftirqd_task(cpu) = current;
 
        for (;;) {
-               if (!softirq_pending(cpu))
+               if (!local_softirq_pending())
                        schedule();
 
                __set_current_state(TASK_RUNNING);
 
-               while (softirq_pending(cpu)) {
+               while (local_softirq_pending()) {
                        do_softirq();
                        cond_resched();
                }