lkml.org 
[lkml]   [2001]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [patch] softirq performance fixes, cleanups, 2.4.10.
From
Date
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/
\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.052 / U:1.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site