Blackfin: drop board resources for dead devices (pbx/ad9960)
[safe/jmp/linux-2.6] / kernel / rcutree.c
index cc02557..6b11b07 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/rcupdate.h>
 #include <linux/interrupt.h>
 #include <linux/sched.h>
+#include <linux/nmi.h>
 #include <asm/atomic.h>
 #include <linux/bitops.h>
 #include <linux/module.h>
@@ -81,9 +82,13 @@ struct rcu_state rcu_bh_state = RCU_STATE_INITIALIZER(rcu_bh_state);
 DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
 
 extern long rcu_batches_completed_sched(void);
+static struct rcu_node *rcu_get_root(struct rcu_state *rsp);
 static void cpu_quiet_msk(unsigned long mask, struct rcu_state *rsp,
                          struct rcu_node *rnp, unsigned long flags);
 static void cpu_quiet_msk_finish(struct rcu_state *rsp, unsigned long flags);
+#ifdef CONFIG_HOTPLUG_CPU
+static void __rcu_offline_cpu(int cpu, struct rcu_state *rsp);
+#endif /* #ifdef CONFIG_HOTPLUG_CPU */
 static void __rcu_process_callbacks(struct rcu_state *rsp,
                                    struct rcu_data *rdp);
 static void __call_rcu(struct rcu_head *head,
@@ -225,7 +230,6 @@ static int rcu_implicit_offline_qs(struct rcu_data *rdp)
 #endif /* #ifdef CONFIG_SMP */
 
 #ifdef CONFIG_NO_HZ
-static DEFINE_RATELIMIT_STATE(rcu_rs, 10 * HZ, 5);
 
 /**
  * rcu_enter_nohz - inform RCU that current CPU is entering nohz
@@ -245,7 +249,7 @@ void rcu_enter_nohz(void)
        rdtp = &__get_cpu_var(rcu_dynticks);
        rdtp->dynticks++;
        rdtp->dynticks_nesting--;
-       WARN_ON_RATELIMIT(rdtp->dynticks & 0x1, &rcu_rs);
+       WARN_ON_ONCE(rdtp->dynticks & 0x1);
        local_irq_restore(flags);
 }
 
@@ -264,7 +268,7 @@ void rcu_exit_nohz(void)
        rdtp = &__get_cpu_var(rcu_dynticks);
        rdtp->dynticks++;
        rdtp->dynticks_nesting++;
-       WARN_ON_RATELIMIT(!(rdtp->dynticks & 0x1), &rcu_rs);
+       WARN_ON_ONCE(!(rdtp->dynticks & 0x1));
        local_irq_restore(flags);
        smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 }
@@ -283,7 +287,7 @@ void rcu_nmi_enter(void)
        if (rdtp->dynticks & 0x1)
                return;
        rdtp->dynticks_nmi++;
-       WARN_ON_RATELIMIT(!(rdtp->dynticks_nmi & 0x1), &rcu_rs);
+       WARN_ON_ONCE(!(rdtp->dynticks_nmi & 0x1));
        smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 }
 
@@ -302,7 +306,7 @@ void rcu_nmi_exit(void)
                return;
        smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
        rdtp->dynticks_nmi++;
-       WARN_ON_RATELIMIT(rdtp->dynticks_nmi & 0x1, &rcu_rs);
+       WARN_ON_ONCE(rdtp->dynticks_nmi & 0x1);
 }
 
 /**
@@ -318,7 +322,7 @@ void rcu_irq_enter(void)
        if (rdtp->dynticks_nesting++)
                return;
        rdtp->dynticks++;
-       WARN_ON_RATELIMIT(!(rdtp->dynticks & 0x1), &rcu_rs);
+       WARN_ON_ONCE(!(rdtp->dynticks & 0x1));
        smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 }
 
@@ -337,7 +341,7 @@ void rcu_irq_exit(void)
                return;
        smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
        rdtp->dynticks++;
-       WARN_ON_RATELIMIT(rdtp->dynticks & 0x1, &rcu_rs);
+       WARN_ON_ONCE(rdtp->dynticks & 0x1);
 
        /* If the interrupt queued a callback, get out of dyntick mode. */
        if (__get_cpu_var(rcu_sched_data).nxtlist ||
@@ -502,6 +506,8 @@ static void print_other_cpu_stall(struct rcu_state *rsp)
        }
        printk(" (detected by %d, t=%ld jiffies)\n",
               smp_processor_id(), (long)(jiffies - rsp->gp_start));
+       trigger_all_cpu_backtrace();
+
        force_quiescent_state(rsp, 0);  /* Kick them all. */
 }
 
@@ -512,12 +518,14 @@ static void print_cpu_stall(struct rcu_state *rsp)
 
        printk(KERN_ERR "INFO: RCU detected CPU %d stall (t=%lu jiffies)\n",
                        smp_processor_id(), jiffies - rsp->gp_start);
-       dump_stack();
+       trigger_all_cpu_backtrace();
+
        spin_lock_irqsave(&rnp->lock, flags);
        if ((long)(jiffies - rsp->jiffies_stall) >= 0)
                rsp->jiffies_stall =
                        jiffies + RCU_SECONDS_TILL_STALL_RECHECK;
        spin_unlock_irqrestore(&rnp->lock, flags);
+
        set_need_resched();  /* kick ourselves to get things going. */
 }
 
@@ -873,6 +881,7 @@ static void __rcu_offline_cpu(int cpu, struct rcu_state *rsp)
                        spin_unlock(&rnp->lock); /* irqs remain disabled. */
                        break;
                }
+               rcu_preempt_offline_tasks(rsp, rnp);
                mask = rnp->grpmask;
                spin_unlock(&rnp->lock);        /* irqs remain disabled. */
                rnp = rnp->parent;
@@ -920,6 +929,7 @@ static void rcu_offline_cpu(int cpu)
 {
        __rcu_offline_cpu(cpu, &rcu_sched_state);
        __rcu_offline_cpu(cpu, &rcu_bh_state);
+       rcu_preempt_offline_cpu(cpu);
 }
 
 #else /* #ifdef CONFIG_HOTPLUG_CPU */