[ARM] 4713/3: Adds drivers for IXP4xx QMgr and NPE features
[safe/jmp/linux-2.6] / kernel / softirq.c
index 73217a9..d7837d4 100644 (file)
@@ -3,7 +3,9 @@
  *
  *     Copyright (C) 1992 Linus Torvalds
  *
- * Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903)
+ *     Distribute under GPLv2.
+ *
+ *     Rewritten. Old one was good in 2.2, but in 2.3 it was immoral. --ANK (990903)
  */
 
 #include <linux/module.h>
@@ -14,6 +16,7 @@
 #include <linux/notifier.h>
 #include <linux/percpu.h>
 #include <linux/cpu.h>
+#include <linux/freezer.h>
 #include <linux/kthread.h>
 #include <linux/rcupdate.h>
 #include <linux/smp.h>
@@ -270,8 +273,6 @@ asmlinkage void do_softirq(void)
        local_irq_restore(flags);
 }
 
-EXPORT_SYMBOL(do_softirq);
-
 #endif
 
 /*
@@ -279,9 +280,14 @@ EXPORT_SYMBOL(do_softirq);
  */
 void irq_enter(void)
 {
+#ifdef CONFIG_NO_HZ
+       int cpu = smp_processor_id();
+       if (idle_cpu(cpu) && !in_interrupt())
+               tick_nohz_stop_idle(cpu);
+#endif
        __irq_enter();
 #ifdef CONFIG_NO_HZ
-       if (idle_cpu(smp_processor_id()))
+       if (idle_cpu(cpu))
                tick_nohz_update_jiffies();
 #endif
 }
@@ -331,8 +337,6 @@ inline fastcall void raise_softirq_irqoff(unsigned int nr)
                wakeup_softirqd();
 }
 
-EXPORT_SYMBOL(raise_softirq_irqoff);
-
 void fastcall raise_softirq(unsigned int nr)
 {
        unsigned long flags;
@@ -488,8 +492,6 @@ void __init softirq_init(void)
 
 static int ksoftirqd(void * __bind_cpu)
 {
-       current->flags |= PF_NOFREEZE;
-
        set_current_state(TASK_INTERRUPTIBLE);
 
        while (!kthread_should_stop()) {
@@ -614,12 +616,16 @@ static int __cpuinit cpu_callback(struct notifier_block *nfb,
                kthread_bind(per_cpu(ksoftirqd, hotcpu),
                             any_online_cpu(cpu_online_map));
        case CPU_DEAD:
-       case CPU_DEAD_FROZEN:
+       case CPU_DEAD_FROZEN: {
+               struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
+
                p = per_cpu(ksoftirqd, hotcpu);
                per_cpu(ksoftirqd, hotcpu) = NULL;
+               sched_setscheduler(p, SCHED_FIFO, &param);
                kthread_stop(p);
                takeover_tasklets(hotcpu);
                break;
+       }
 #endif /* CONFIG_HOTPLUG_CPU */
        }
        return NOTIFY_OK;