mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "David S. Miller" <davem@redhat.com>
Cc: jfaulkne@ccs.neu.edu, linux-kernel@vger.kernel.org, kraxel@bytesex.org
Subject: Re: major network performance difference between 2.4 and 2.6.2-rc2
Date: Wed, 4 Feb 2004 13:22:48 -0800	[thread overview]
Message-ID: <20040204132248.39b19895.akpm@osdl.org> (raw)
In-Reply-To: <20040204130839.1023c2f2.davem@redhat.com>

"David S. Miller" <davem@redhat.com> wrote:
>
> On Wed, 4 Feb 2004 12:54:44 -0800
> Andrew Morton <akpm@osdl.org> wrote:
> 
> > Jim Faulkner <jfaulkne@ccs.neu.edu> wrote:
> > >   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
> > >   3 root      35  19     0    0    0 S 45.9  0.0   0:46.98 ksoftirqd/0
> > >   6 root       5 -10     0    0    0 S 43.3  0.0   1:56.63 events/0
> > >   12008 dogshu 15   0  4800 2356 3828 S  5.3  0.2   0:05.98 proftpd
> > >   12 root      15   0     0    0    0 S  0.3  0.0   0:00.41 pdflush
> > >   9778 root    16   0  5888 1724 5516 R  0.3  0.2   0:00.12 sshd
> > > 
> > > the load before that network transfer was 0.01, and the load after the
> > > network transfer was 1.45.
> > 
> > Could be a networking problem, but boy that's a lot of CPU time.
> 
> Andrew maybe something bolixed in the MAX_SOFTIRQ_RESTART stuff
> we put into kernel/softirq.c?  Just a guess...

Might be.  Jim, does a `patch -p1 -R' of the below help things?



diff -Nru a/kernel/softirq.c b/kernel/softirq.c
--- a/kernel/softirq.c	Wed Feb  4 13:20:39 2004
+++ b/kernel/softirq.c	Wed Feb  4 13:20:39 2004
@@ -57,11 +57,22 @@
 		wake_up_process(tsk);
 }
 
+/*
+ * We restart softirq processing MAX_SOFTIRQ_RESTART times,
+ * and we fall back to softirqd after that.
+ *
+ * This number has been established via experimentation.
+ * The two things to balance is latency against fairness -
+ * we want to handle softirqs as soon as possible, but they
+ * should not be able to lock up the box.
+ */
+#define MAX_SOFTIRQ_RESTART 10
+
 asmlinkage void do_softirq(void)
 {
+	int max_restart = MAX_SOFTIRQ_RESTART;
 	__u32 pending;
 	unsigned long flags;
-	__u32 mask;
 
 	if (in_interrupt())
 		return;
@@ -73,7 +84,6 @@
 	if (pending) {
 		struct softirq_action *h;
 
-		mask = ~pending;
 		local_bh_disable();
 restart:
 		/* Reset the pending bitmask before enabling irqs */
@@ -93,10 +103,8 @@
 		local_irq_disable();
 
 		pending = local_softirq_pending();
-		if (pending & mask) {
-			mask &= ~pending;
+		if (pending && --max_restart)
 			goto restart;
-		}
 		if (pending)
 			wakeup_softirqd();
 		__local_bh_enable();


  reply	other threads:[~2004-02-04 21:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-31  3:06 Jim Faulkner
2004-01-31 14:28 ` Felipe Alfaro Solana
2004-02-04 20:42 ` Jim Faulkner
2004-02-04 20:54   ` Andrew Morton
2004-02-04 21:08     ` David S. Miller
2004-02-04 21:22       ` Andrew Morton [this message]
2004-02-05  4:57     ` Jim Faulkner
2004-02-06 21:14       ` Bill Davidsen
2004-02-07 17:56         ` Hilko Bengen
2004-02-18  3:33           ` Bill Davidsen
2004-02-04 21:28   ` Gerd Knorr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040204132248.39b19895.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=davem@redhat.com \
    --cc=jfaulkne@ccs.neu.edu \
    --cc=kraxel@bytesex.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®