Skip to content

Commit

Permalink
softirq: A single rcu_bh_qs() call per softirq set is enough
Browse files Browse the repository at this point in the history
Calling rcu_bh_qs() after every softirq action is not really needed.
What RCU needs is at least one rcu_bh_qs() per softirq round to note a
quiescent state was passed for rcu_bh.

Note for Paul and myself : this could be inlined as a single instruction
and avoid smp_processor_id()
(sone this_cpu_write(rcu_bh_data.passed_quiesce, 1))

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
  • Loading branch information
Eric Dumazet authored and Paul E. McKenney committed Apr 29, 2014
1 parent fa07a58 commit a5d6d3a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions kernel/softirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ asmlinkage void __do_softirq(void)
bool in_hardirq;
__u32 pending;
int softirq_bit;
int cpu;

/*
* Mask out PF_MEMALLOC s current task context is borrowed for the
Expand All @@ -247,7 +246,6 @@ asmlinkage void __do_softirq(void)
__local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET);
in_hardirq = lockdep_softirq_start();

cpu = smp_processor_id();
restart:
/* Reset the pending bitmask before enabling irqs */
set_softirq_pending(0);
Expand Down Expand Up @@ -276,11 +274,11 @@ asmlinkage void __do_softirq(void)
prev_count, preempt_count());
preempt_count_set(prev_count);
}
rcu_bh_qs(cpu);
h++;
pending >>= softirq_bit;
}

rcu_bh_qs(smp_processor_id());
local_irq_disable();

pending = local_softirq_pending();
Expand Down

0 comments on commit a5d6d3a

Please sign in to comment.