Re: [patch] softirq performance fixes, cleanups, 2.4.10.

Oleg Nesterov (oleg@tv-sign.ru)
Fri, 28 Sep 2001 03:29:13 +0400


Hello.

I am trying to understand the basics of softirq handling.

It seems to me that ksoftirqd()'s loop can be cleanuped a bit
with following (untested) patch on top of 2.4.10-softirq-A7.

It also removes the 'mask' variable in do_softirq().

Oleg

--- 2.4.10-softirq-A7/kernel/softirq.c.orig Thu Sep 27 22:31:06 2001
+++ 2.4.10-softirq-A7/kernel/softirq.c Thu Sep 27 22:54:37 2001
@@ -85,7 +85,7 @@
{
int max_restart = MAX_SOFTIRQ_RESTART;
int cpu = smp_processor_id();
- __u32 pending, mask;
+ __u32 pending;
long flags;

if (in_interrupt())
@@ -98,7 +98,6 @@
if (pending) {
struct softirq_action *h;

- mask = ~pending;
local_bh_disable();
restart:
/* Reset the pending bitmask before enabling irqs */
@@ -381,26 +380,22 @@
#endif

current->nice = 19;
- schedule();
- __set_current_state(TASK_INTERRUPTIBLE);
ksoftirqd_task(cpu) = current;

for (;;) {
-back:
+ schedule();
+ __set_current_state(TASK_INTERRUPTIBLE);
+
do {
do_softirq();
if (current->need_resched)
goto preempt;
} while (softirq_pending(cpu));
- schedule();
- __set_current_state(TASK_INTERRUPTIBLE);
- }

+ continue;
preempt:
- __set_current_state(TASK_RUNNING);
- schedule();
- __set_current_state(TASK_INTERRUPTIBLE);
- goto back;
+ __set_current_state(TASK_RUNNING);
+ }
}

static __init int spawn_ksoftirqd(void)
-
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/