public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] __do_softirq() loop cleanup
@ 2007-10-10 12:16 Johannes Weiner
  2007-10-12  2:26 ` Steven Rostedt
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Weiner @ 2007-10-10 12:16 UTC (permalink / raw)
  To: Linux Kernel Mailing List

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();

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] __do_softirq() loop cleanup
  2007-10-10 12:16 [PATCH] __do_softirq() loop cleanup Johannes Weiner
@ 2007-10-12  2:26 ` Steven Rostedt
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Rostedt @ 2007-10-12  2:26 UTC (permalink / raw)
  To: Linux Kernel Mailing List

On Wed, Oct 10, 2007 at 02:16:19PM +0200, Johannes Weiner wrote:
> 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>
> 

I've read over the logic three times and it seems to keep with the
original design.  So unless I missed something ...

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-12  2:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10 12:16 [PATCH] __do_softirq() loop cleanup Johannes Weiner
2007-10-12  2:26 ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox