Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.5.75 /kernel/softirq.c

Filename:/kernel/softirq.c
Lines Added:17
Lines Deleted:13
Also changed in: (Previous) 2.5.74-bk7  2.5.74-bk6  2.5.74-bk5  2.5.74-bk4  2.5.74-bk3  2.5.74-bk2 
(Following)

Location
[  2.5.75
  [  kernel
     o  softirq.c

Patch

diff -Nru a/kernel/softirq.c b/kernel/softirq.c
--- a/kernel/softirq.c   Thu Jul 10 13:16:26 2003
+++ b/kernel/softirq.c   Thu Jul 10 13:16:26 2003
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/notifier.h>
+#include <linux/percpu.h>
 #include <linux/cpu.h>
 
 /*
@@ -41,15 +42,18 @@
 
 static struct softirq_action softirq_vec[32] __cacheline_aligned_in_smp;
 
+static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
+
 /*
  * we cannot loop indefinitely here to avoid userspace starvation,
  * but we also don't want to introduce a worst case 1/HZ latency
  * to the pending events, so lets the scheduler to balance
  * the softirq load for us.
  */
-static inline void wakeup_softirqd(unsigned cpu)
+static inline void wakeup_softirqd(void)
 {
-   struct task_struct * tsk = ksoftirqd_task(cpu);
+   /* Interrupts are disabled: no need to stop preemption */
+   struct task_struct *tsk = __get_cpu_var(ksoftirqd);
 
    if (tsk && tsk->state != TASK_RUNNING)
       wake_up_process(tsk);
@@ -96,7 +100,7 @@
          goto restart;
       }
       if (pending)
-         wakeup_softirqd(smp_processor_id());
+         wakeup_softirqd();
       __local_bh_enable();
    }
 
@@ -117,9 +121,9 @@
 /*
  * This function must run with irqs disabled!
  */
-inline void cpu_raise_softirq(unsigned int cpu, unsigned int nr)
+inline void raise_softirq_irqoff(unsigned int nr)
 {
-   __cpu_raise_softirq(cpu, nr);
+   __raise_softirq_irqoff(nr);
 
    /*
     * If we're in an interrupt or softirq, we're done
@@ -131,7 +135,7 @@
     * schedule the softirq soon.
     */
    if (!in_interrupt())
-      wakeup_softirqd(cpu);
+      wakeup_softirqd();
 }
 
 void raise_softirq(unsigned int nr)
@@ -139,7 +143,7 @@
    unsigned long flags;
 
    local_irq_save(flags);
-   cpu_raise_softirq(smp_processor_id(), nr);
+   raise_softirq_irqoff(nr);
    local_irq_restore(flags);
 }
 
@@ -168,7 +172,7 @@
    local_irq_save(flags);
    t->next = __get_cpu_var(tasklet_vec).list;
    __get_cpu_var(tasklet_vec).list = t;
-   cpu_raise_softirq(smp_processor_id(), TASKLET_SOFTIRQ);
+   raise_softirq_irqoff(TASKLET_SOFTIRQ);
    local_irq_restore(flags);
 }
 
@@ -179,7 +183,7 @@
    local_irq_save(flags);
    t->next = __get_cpu_var(tasklet_hi_vec).list;
    __get_cpu_var(tasklet_hi_vec).list = t;
-   cpu_raise_softirq(smp_processor_id(), HI_SOFTIRQ);
+   raise_softirq_irqoff(HI_SOFTIRQ);
    local_irq_restore(flags);
 }
 
@@ -211,7 +215,7 @@
       local_irq_disable();
       t->next = __get_cpu_var(tasklet_vec).list;
       __get_cpu_var(tasklet_vec).list = t;
-      __cpu_raise_softirq(smp_processor_id(), TASKLET_SOFTIRQ);
+      __raise_softirq_irqoff(TASKLET_SOFTIRQ);
       local_irq_enable();
    }
 }
@@ -244,7 +248,7 @@
       local_irq_disable();
       t->next = __get_cpu_var(tasklet_hi_vec).list;
       __get_cpu_var(tasklet_hi_vec).list = t;
-      __cpu_raise_softirq(smp_processor_id(), HI_SOFTIRQ);
+      __raise_softirq_irqoff(HI_SOFTIRQ);
       local_irq_enable();
    }
 }
@@ -325,7 +329,7 @@
    __set_current_state(TASK_INTERRUPTIBLE);
    mb();
 
-   local_ksoftirqd_task() = current;
+   __get_cpu_var(ksoftirqd) = current;
 
    for (;;) {
       if (!local_softirq_pending())
@@ -354,7 +358,7 @@
          return NOTIFY_BAD;
       }
 
-      while (!ksoftirqd_task(hotcpu))
+      while (!per_cpu(ksoftirqd, hotcpu))
          yield();
     }
    return NOTIFY_OK;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.