summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-10-04 14:33:53 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:21:08 (GMT)
commite7a79b423f6cb2b508ddc8932a42ce352877bb29 (patch)
tree736b62e8be275a473595e555f069b12b0e24f7d4 /kernel
parentd64accdd6c7c91ae0f2333bab3d83f6898f2693d (diff)
downloadlinux-fsl-qoriq-e7a79b423f6cb2b508ddc8932a42ce352877bb29.tar.xz
softirq: Split handling function
Split out the inner handling function, so RT can reuse it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/softirq.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 984942a..b1cc151 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -142,31 +142,34 @@ static void wakeup_softirqd(void)
wake_up_process(tsk);
}
-static void handle_pending_softirqs(u32 pending, int cpu, int need_rcu_bh_qs)
+static void handle_softirq(unsigned int vec_nr, int cpu, int need_rcu_bh_qs)
{
- struct softirq_action *h = softirq_vec;
+ struct softirq_action *h = softirq_vec + vec_nr;
unsigned int prev_count = preempt_count();
- local_irq_enable();
- for (; pending; h++, pending >>= 1) {
- unsigned int vec_nr = h - softirq_vec;
+ kstat_incr_softirqs_this_cpu(vec_nr);
+ trace_softirq_entry(vec_nr);
+ h->action(h);
+ trace_softirq_exit(vec_nr);
- if (!(pending & 1))
- continue;
+ if (unlikely(prev_count != preempt_count())) {
+ pr_err("softirq %u %s %p preempt count leak: %08x -> %08x\n",
+ vec_nr, softirq_to_name[vec_nr], h->action,
+ prev_count, (unsigned int) preempt_count());
+ preempt_count() = prev_count;
+ }
+ if (need_rcu_bh_qs)
+ rcu_bh_qs(cpu);
+}
- kstat_incr_softirqs_this_cpu(vec_nr);
- trace_softirq_entry(vec_nr);
- h->action(h);
- trace_softirq_exit(vec_nr);
- if (unlikely(prev_count != preempt_count())) {
- pr_err(
-"huh, entered softirq %u %s %p with preempt_count %08x exited with %08x?\n",
- vec_nr, softirq_to_name[vec_nr], h->action,
- prev_count, (unsigned int) preempt_count());
- preempt_count() = prev_count;
- }
- if (need_rcu_bh_qs)
- rcu_bh_qs(cpu);
+static void handle_pending_softirqs(u32 pending, int cpu, int need_rcu_bh_qs)
+{
+ unsigned int vec_nr;
+
+ local_irq_enable();
+ for (vec_nr = 0; pending; vec_nr++, pending >>= 1) {
+ if (pending & 1)
+ handle_softirq(vec_nr, cpu, need_rcu_bh_qs);
}
local_irq_disable();
}