aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-10-04 15:33:53 +0100
committerAnders Roxell <anders.roxell@linaro.org>2015-06-26 22:31:25 +0200
commit27a0ec7915d5032a2cef772abb254ff1ac4e16b1 (patch)
tree51d30011de2656580305f49a02f1ac9b25b33997
parent702fb54502912dbe7b039448e4b8140a5bbd4c25 (diff)
softirq: Split handling function
Split out the inner handling function, so RT can reuse it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/softirq.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 9f57c81ce358..9c328610d3c9 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -141,10 +141,29 @@ static void wakeup_softirqd(void)
wake_up_process(tsk);
}
+static void handle_softirq(unsigned int vec_nr, int cpu, int need_rcu_bh_qs)
+{
+ struct softirq_action *h = softirq_vec + vec_nr;
+ unsigned int prev_count = preempt_count();
+
+ 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, preempt_count());
+ preempt_count_set(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)
{
struct softirq_action *h = softirq_vec;
- unsigned int prev_count = preempt_count();
int softirq_bit;
local_irq_enable();
@@ -156,19 +175,8 @@ static void handle_pending_softirqs(u32 pending, int cpu, int need_rcu_bh_qs)
h += softirq_bit - 1;
vec_nr = h - softirq_vec;
- kstat_incr_softirqs_this_cpu(vec_nr);
+ handle_softirq(vec_nr, cpu, need_rcu_bh_qs);
- 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, preempt_count());
- preempt_count_set(prev_count);
- }
- if (need_rcu_bh_qs)
- rcu_bh_qs(cpu);
h++;
pending >>= softirq_bit;
}