lkml.org 
[lkml]   [2007]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] __do_softirq() loop cleanup
Hi,

This changes __do_softirq() to use a C looping construct instead of
simulating one by means of goto.

Signed-off-by: Johannes Weiner <hannes-kernel@saeurebad.de>

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 0f546dd..bacee6b 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -212,38 +212,37 @@ asmlinkage void __do_softirq(void)
int max_restart = MAX_SOFTIRQ_RESTART;
int cpu;

- pending = local_softirq_pending();
account_system_vtime(current);

__local_bh_disable((unsigned long)__builtin_return_address(0));
trace_softirq_enter();

cpu = smp_processor_id();
-restart:
- /* Reset the pending bitmask before enabling irqs */
- set_softirq_pending(0);

- local_irq_enable();
+ while ((pending = local_softirq_pending())) {
+ if (!max_restart--) {
+ wakeup_softirqd();
+ break;
+ }

- h = softirq_vec;
+ /* Reset the pending bitmask before enabling irqs */
+ set_softirq_pending(0);

- do {
- if (pending & 1) {
- h->action(h);
- rcu_bh_qsctr_inc(cpu);
- }
- h++;
- pending >>= 1;
- } while (pending);
+ local_irq_enable();

- local_irq_disable();
+ h = softirq_vec;

- pending = local_softirq_pending();
- if (pending && --max_restart)
- goto restart;
+ do {
+ if (pending & 1) {
+ h->action(h);
+ rcu_bh_qsctr_inc(cpu);
+ }
+ h++;
+ pending >>= 1;
+ } while (pending);

- if (pending)
- wakeup_softirqd();
+ local_irq_disable();
+ }

trace_softirq_exit();
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-10-10 14:19    [W:0.028 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site