mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: "David S. Miller" <davem@redhat.com>
Cc: akpm@digeo.com, davidsen@tmr.com, haveblue@us.ibm.com,
	habanero@us.ibm.com, mbligh@aracnet.com,
	linux-kernel@vger.kernel.org
Subject: Re: userspace irq balancer
Date: Wed, 28 May 2003 00:27:12 +0200	[thread overview]
Message-ID: <20030527222712.GB1453@dualathlon.random> (raw)
In-Reply-To: <20030527.150449.08322270.davem@redhat.com>

On Tue, May 27, 2003 at 03:04:49PM -0700, David S. Miller wrote:
>    From: Andrea Arcangeli <andrea@suse.de>
>    Date: Tue, 27 May 2003 13:53:14 +0200
> 
>    in case it wasn't obvious (that is the whole point of ksoftirqd) what
>    accomplishes in a single word is "fairness" and "not starving userspace
>    during networking".
> 
> The problem is that is gives up and goes to ksoftirqd far too easily.

I see your point, please try with 2.4.21rc4aa1 or with this patch:

	http://www.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.21rc4aa1/00_ksoftirqd-max-loop-networking-1

you can put a printk in the ksoftirqd loop and tune the N until it
behaves as you want.

> Also, if a softirq is triggered between when we wake up ksoftirqd and
> ksoftirqd actually runs, we just run the loop again in do_softirq().

but the loop will do nothing, I mean ksoftirqd is checking if some work
has to be done, and that's achieved in do_softirq, exactly the same that
each irq does before returning to userspace. no difference.

> This situation is even more likely if we are being "softirq bombed".
> In fact in such a situation it is almost a certainty that do_softirq()
> will execute multiple times before we schedule to any task.
> 
> In fact, and here is the important part, we probably won't run very
> much userspace at all if we are being "softirq bombed".  Every trap,
> softirq causing or not, is going to cause us to drop into do_softirq()
> again and again and again.
> 
> Perhaps even, we will drain the pending softirqs before ksoftirqd even
> gets to execute.  In this case the ksoftirqd wakeup and context switch
> is a total waste of cpu cycles.
> 
> You are trying to apply flow control in an odd way to softirqs.
> But the problem with such schemes is that they absolutely do not
> make the problem go away.  You are merely moving the work from one
> place to another, and in many cases added more useless work.  The one
> thing you don't do when you are resource limited is take more of those
> resources away and that is exactly what the ksoftirqd scheme does.

That's a purerly theorical case that also Ingo made once, but you should
do all the theory and also compute the probability of the irqs arriving
at the exact timing that forbids userspace to make progress with the
ksoftirqd design for a significant amount of time. That is too low to
care about it.  While when you're flooded at max speed ksoftirqd
generates a fair load, plus it allows NAPI to work at all which is
needed on firewalls.

The only problem I can see is that the spikes of load may generate
spurious ksoftirqd reschedules, I acknowledge that, and for those we can
just change the #define in teh above patch. I flooded my boxes through
100mbit and ksoftirqd apparently isn't running at all (not that I ever
noticed it running significantly though ;). I don't have gigabit to test
that's why I ask.

Andrea

  reply	other threads:[~2003-05-27 22:13 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-21 21:43 Nakajima, Jun
2003-05-22  0:29 ` Gerrit Huizenga
2003-05-22  1:28   ` Martin J. Bligh
2003-05-22  1:44     ` Gerrit Huizenga
2003-05-22  2:03       ` William Lee Irwin III
2003-05-22  2:04   ` William Lee Irwin III
2003-05-22  2:12     ` Zwane Mwaikambo
2003-05-22  3:57     ` Martin J. Bligh
2003-05-22 17:24       ` Bill Davidsen
2003-05-22 22:44         ` David S. Miller
2003-05-26 22:24           ` Andrea Arcangeli
2003-05-26 23:26             ` Andrew Morton
2003-05-26 23:34               ` Andrea Arcangeli
2003-05-26 23:43                 ` David S. Miller
     [not found]                   ` <20030527000639.GA3767@dualathlon.random>
2003-05-27  0:15                     ` David S. Miller
2003-05-27  0:41                       ` Andrea Arcangeli
2003-05-27  0:48                         ` David S. Miller
2003-05-27  1:09                           ` Andrea Arcangeli
2003-05-27  1:13                             ` David S. Miller
2003-05-27  1:26                               ` Andrea Arcangeli
2003-05-27  6:11                                 ` David S. Miller
2003-05-27 11:53                                   ` Andrea Arcangeli
2003-05-27 22:04                                     ` David S. Miller
2003-05-27 22:27                                       ` Andrea Arcangeli [this message]
2003-05-27 23:55                                         ` David S. Miller
2003-06-13  6:22                                         ` David S. Miller
2003-06-13 18:23                                           ` Andrea Arcangeli
2003-05-27  1:16                             ` Dave Jones
2003-05-27  1:17                               ` David S. Miller
2003-05-27  9:07                                 ` Arjan van de Ven
2003-05-27  9:10                                   ` David S. Miller
2003-05-27  1:28                               ` Andrea Arcangeli
2003-05-27  1:53                           ` William Lee Irwin III
2003-05-27  1:59                             ` Andrew Morton
2003-05-27  2:10                               ` William Lee Irwin III
2003-05-27  2:15                                 ` Zwane Mwaikambo
2003-05-27  2:44                                   ` William Lee Irwin III
2003-05-27  2:45                                     ` Zwane Mwaikambo
2003-05-27  4:22                                       ` William Lee Irwin III
2003-05-27  2:15                               ` Andrea Arcangeli
2003-05-27  2:14                             ` Andrea Arcangeli
2003-05-27  2:26                               ` William Lee Irwin III
2003-05-27  1:17                 ` Andrea Arcangeli
2003-05-27  1:20                   ` David S. Miller
2003-05-27  1:33                     ` Andrea Arcangeli
2003-05-22 14:18     ` James Cleverdon
2003-05-22 14:43       ` William Lee Irwin III
2003-05-22 15:30         ` James Cleverdon
2003-05-22 15:45           ` William Lee Irwin III
  -- strict thread matches above, loose matches on Subject: below --
2003-05-24  1:10 Nakajima, Jun
2003-05-21 18:28 Keith Mannthey
2003-05-21 23:39 ` Keith Mannthey
2003-05-22  8:17   ` Arjan van de Ven
2003-05-21 16:31 James Bottomley
2003-05-21 20:16 ` Arjan van de Ven
2003-05-20 15:41 Nakajima, Jun
2003-05-21 13:54 ` James Cleverdon
2003-05-21 22:56   ` Zwane Mwaikambo
     [not found] <200305191314.06216.pbadari@us.ibm.com>
2003-05-19 22:07 ` Dave Hansen
2003-05-19 22:11   ` Arjan van de Ven
2003-05-19 22:22     ` Dave Hansen
2003-05-20  3:25       ` David S. Miller
2003-05-20  3:46         ` William Lee Irwin III
2003-05-20  5:03           ` Dave Hansen
2003-05-20  5:53             ` Martin J. Bligh
2003-05-20  6:13               ` David S. Miller
2003-05-20  6:36                 ` Dave Hansen
2003-05-20  6:40                   ` David S. Miller
2003-05-20 14:07                     ` Andrew Theurer
2003-05-20 14:21                       ` Jeff Garzik
2003-05-20 14:35                         ` Andrew Theurer
     [not found]                       ` <20030520.163833.104040023.davem@redhat.com>
2003-05-21 14:58                         ` Martin J. Bligh
2003-05-21 22:55                           ` David S. Miller
2003-05-21 11:00                     ` Kai Bankett
2003-05-20 14:01                 ` Martin J. Bligh
2003-05-20  9:00             ` Arjan van de Ven
2003-05-20  9:14               ` William Lee Irwin III
2003-05-20  9:17               ` Andrew Morton
     [not found]                 ` <20030520.172230.102567463.davem@redhat.com>
2003-05-21 14:27                   ` James Cleverdon

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=20030527222712.GB1453@dualathlon.random \
    --to=andrea@suse.de \
    --cc=akpm@digeo.com \
    --cc=davem@redhat.com \
    --cc=davidsen@tmr.com \
    --cc=habanero@us.ibm.com \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.com \
    /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®