netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kuznet@ms2.inr.ac.ru
To: andrea@suse.de (Andrea Arcangeli)
Cc: dipankar@in.ibm.com, linux-kernel@vger.kernel.org,
	netdev@oss.sgi.com, Robert.Olsson@data.slu.se,
	paulmck@us.ibm.com (Paul E. McKenney),
	davem@redhat.com (Dave Miller),
	kuznet@ms2.inr.ac.ru (Alexey Kuznetsov),
	akpm@osdl.org (Andrew Morton)
Subject: Re: route cache DoS testing and softirqs
Date: Wed, 31 Mar 2004 00:05:05 +0400 (MSD)	[thread overview]
Message-ID: <200403302005.AAA00466@yakov.inr.ac.ru> (raw)
In-Reply-To: <20040329222926.GF3808@dualathlon.random> from "Andrea Arcangeli" at íÁÒ 30, 2004 12:29:26

Hello!

> > Robert demonstrated to us sometime ago with a small
> > timestamping user program to show that it can get starved for
> > more than 6 seconds in his system. So userland starvation is an
> > issue.
> 
> softirqs are already capable of being offloaded to scheduler-friendy
> kernel threads to avoid starvation, if this wasn't the case NAPI would
> have no way to work in the first place and everything else would fall
> apart too, not just the rcu-route-cache. I don't think high latencies
> and starvation are the same thing, starvation means for "indefinite
> time" and you can't hang userspace for indefinite time using softirqs.
> For sure the irq based load, and in turn softirqs too, can take a large
> amount of cpu (though not 100%, this is why it cannot be called
> starvation).
> 
> the only real starvation you can claim is in presence of an _hard_irq
> flood, not a softirq one.

There are no hardirqs in the case under investigation, remember?

What's about the problem it really splits to two ones:

1. The _new_ problem when bad latency of rcu hurts core
   functionality. This is precise description:

> to keep up with the softirq load.  This has never been the case so far,
> and serving softirq as fast as possible is normally a good thing for
> server/firewalls, the small unfariness (note unfariness != starvation)
> it generates has never been an issue, because so far the softirq never
> required the scheduler to work in order to do their work, rcu changed
> this in the routing cache specific case.

We had one full solution for this issue not changing anything
in scheduler/softirq relationship: to run rcu task for the things
sort of dst cache not from process context, but essentially as part
of do_softirq(). Simple, stupid and apparently solves new problems
which rcu created.

Another solution is just to increase memory consumption limits
to deal with current rcu latency. F.e. 300ms latency just requires
additional space for pps*300ms objects, which are handled by RCU.
The problem with this is that pps is the thing which increases
when cpu power grows and that 300ms is not a mathematically established
limit too.


> So you're simply asking the ksoftirqd offloading to become more
> aggressive,

It is the second challenge.

Andrea, it is experimenatl fact: this "small unfariness" stalls process
contexts for >=6 seconds and gives them microscopic slices. We could live
with this (provided RCU problem is solved in some way). Essentially,
the only trouble for me was that we could use existing rcu bits to make
offloading to ksoftirqd more smart (not aggressive, _smart_). The absense
of RCU quiescent states looks too close to absence of forward progress
in process contexts, it was anticipating similarity. The dumb throttling
do_softirq made not from ksoftirqd context when starvation is detected
which we tested the last summer is not only ugly, it really might hurt
router performance, you are right here too. It is the challenge:
or we proceed with this idea and invent something, or we just forget
about this concentrating on RCU.

Alexey

  parent reply	other threads:[~2004-03-30 20:05 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-29 18:45 route cache DoS testing and softirqs Dipankar Sarma
2004-03-29 22:29 ` Andrea Arcangeli
2004-03-30  5:06   ` Srivatsa Vaddagiri
2004-03-30  5:35     ` Srivatsa Vaddagiri
2004-03-30 15:11       ` Andrea Arcangeli
2004-03-31  2:36     ` Rusty Russell
2004-03-30 14:43   ` Dipankar Sarma
2004-03-30 19:53     ` Dipankar Sarma
2004-03-30 20:47       ` Andrea Arcangeli
2004-03-30 21:06         ` Dipankar Sarma
2004-03-30 21:27           ` Andrea Arcangeli
2004-03-30 21:29         ` Robert Olsson
2004-03-31  7:36           ` Dipankar Sarma
2004-03-30 20:05   ` kuznet [this message]
2004-03-30 20:28     ` Dipankar Sarma
2004-04-01  6:00       ` kuznet
2004-03-30 21:14     ` Andrea Arcangeli
2004-03-30 21:30       ` David S. Miller
2004-03-30 21:37         ` Andrea Arcangeli
2004-03-30 22:22           ` David S. Miller
2004-03-30 22:49             ` Andrea Arcangeli
2004-03-31 20:46               ` Dipankar Sarma
2004-03-31 21:31                 ` Andrea Arcangeli
2004-03-31 21:52                   ` Dipankar Sarma
2004-03-30 22:33           ` Robert Olsson
2004-03-31 17:10           ` Dipankar Sarma
2004-03-31 18:46             ` Robert Olsson
2004-03-31 20:37               ` Dipankar Sarma
2004-03-31 21:28                 ` Andrea Arcangeli
2004-03-31 21:43                   ` Dipankar Sarma
2004-04-05 17:11                     ` Robert Olsson
2004-04-05 21:22                       ` Dipankar Sarma
2004-04-06 12:55                         ` Robert Olsson
2004-04-06 19:52                           ` Dipankar Sarma
2004-04-07 15:23                             ` Robert Olsson
2004-04-07 19:48                               ` Dipankar Sarma
2004-04-08 13:29                           ` kuznet
2004-04-08 14:07                             ` Robert Olsson
2004-03-31 22:36                   ` Robert Olsson
2004-03-31 22:52                     ` Andrea Arcangeli
2004-04-01  6:43                       ` kuznet
2004-04-01 13:16                         ` Andrea Arcangeli
2004-04-08 13:38                           ` kuznet
2004-04-01 13:44                       ` Robert Olsson

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=200403302005.AAA00466@yakov.inr.ac.ru \
    --to=kuznet@ms2.inr.ac.ru \
    --cc=Robert.Olsson@data.slu.se \
    --cc=akpm@osdl.org \
    --cc=andrea@suse.de \
    --cc=davem@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=paulmck@us.ibm.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;
as well as URLs for NNTP newsgroup(s).