public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Lee Revell <rlrevell@joe-job.com>,
	Tim Bird <tim.bird@am.sony.com>,
	linux-kernel@vger.kernel.org, bhuey@lnxw.com, tglx@linutronix.de,
	karim@opersys.com, mingo@elte.hu, pmarques@grupopie.com,
	bruce@andrew.cmu.edu, nickpiggin@yahoo.com.au, ak@muc.de,
	sdietrich@mvista.com, dwalker@mvista.com, hch@infradead.org,
	akpm@osdl.org
Subject: Re: Attempted summary of "RT patch acceptance" thread
Date: Fri, 10 Jun 2005 19:37:28 +0200	[thread overview]
Message-ID: <20050610173728.GA6564@g5.random> (raw)
In-Reply-To: <20050610154745.GA1300@us.ibm.com>

Hello Paul,

kudos for your very nice RT documents (as usual ;)

On Fri, Jun 10, 2005 at 08:47:46AM -0700, Paul E. McKenney wrote:
> Good point -- I certainly need to add a disclaimer to the effect that
> common hardware (such as VGA, last I checked some months ago) can

> a.	Quality of service: soft realtime, with timeframe of 100s of
> 	microseconds for task scheduling and interrupt handling, but
> 	-only- for very carefully restricted hardware configurations
> 	that exclude problematic devices and drivers (such as VGA)
> 	that can cause latency bumps of tens or even hundreds of
> 	milliseconds (-not- microseconds).  Furthermore, the software
> 	configuration of such systems must be carefully controlled,
> 	for example, doing a "kill -1" traverses the entire task list
> 	with tasklist_lock held (see kill_something_info()), which might
> 	result in disappointing latencies in systems with very large
> 	numbers of tasks.  System services providing I/O, networking,
> 	task creation, and VM manipulation can take much longer.  A very
> 	small performance penalty is exacted, since spinlocks and RCU
> 	must suppress preemption.
> 
> Does this help, or are there other CONFIG_PREEMPT latency issues that
> need to be called out?

You don't need to add it to the document, but as a further pratical
example of troublesome hardware besides VGA (could be a software issue
and not hardware issue though) I'd like to make the example of the irq
handler of the uhci usb1.1 controller that takes up to 8msec on a 1ghz
atlhon UP system, and there's nothing that PREEMPT can do about it since
it's an hard-irq. This latency keeps triggering a few times per second
on my firewall for the last few years.

preempt-RT _can_ do something about it but only _if_ people hacks the
drivers properly and makes sure to call local_irq_save_nort instead of
local_irq_save and other explicit changes like that, things that if
missing are noticeable only during measurements with preempt-RT config
option enabled (hence the metal-hard classification of preempt-RT and
not ruby-hard definition).

See the tg3 updates required to be safe with preempt-RT without breaking
hard-RT as a clear example of how preempt-RT is weak:

--- linux/drivers/net/tg3.c.orig
+++ linux/drivers/net/tg3.c
@@ -3229,9 +3229,9 @@ static int tg3_start_xmit(struct sk_buff
         * So we really do need to disable interrupts when taking
         * tx_lock here.
         */
-       local_irq_save(flags);
+       local_irq_save_nort(flags);
        if (!spin_trylock(&tp->tx_lock)) { 
-               local_irq_restore(flags);
+               local_irq_restore_nort(flags);
                return NETDEV_TX_LOCKED; 
        } 
 
There's no apparent reason why all those changes should be required to
get hard-RT.

Both RTAI and rtlinux _don't_ require to change all those drivers to get
the guarantee that the kernel will get out of the way within a certain
nanoseconds deadline interval.

Furthermore with the scheduler, mutex and context switch code into the
equation, it gets more and more difficult to calculate with math the max
latency that preempt-RT will provide, while it's almost trivial to do
that with RTAI/rtlinux given only the nanokernel code runs before the
hard-RT code is invoked and there are not many paths to test, so one has
to disable the cache and just measure the few possible nanokenrel paths.
(as usual when speaking about hard-RT I've robots in mind, and not audio
code that will call into the alsa ioctls)

This below is the kind of stuff where I wouldn't even dream to replace
a ruby-hard rtlinux/RTAI with a weaker metal-hard and possibly
underperformant (cause scheduling hard-irq in userland and scheduling
instead of spinning isn't going to be cheap in smp) preempt-RT solution:

http://linuxdevices.com/articles/AT7871136191.html

In the above RTAI should have made it as well as rtlinux of course.

  reply	other threads:[~2005-06-10 17:37 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-08  2:26 Attempted summary of "RT patch acceptance" thread Paul E. McKenney
2005-06-08  3:00 ` Karim Yaghmour
2005-06-08 14:47   ` Paul E. McKenney
2005-06-08 16:51 ` Karim Yaghmour
2005-06-09  2:25   ` Paul E. McKenney
2005-06-09 11:20   ` Philippe Gerum
2005-06-08 18:46 ` Chris Friesen
2005-06-08 19:28   ` Paul E. McKenney
2005-06-10 22:25     ` Eric Piel
2005-06-10 23:04       ` Paul E. McKenney
2005-06-10 23:23         ` Eric Piel
2005-06-11  0:59           ` Paul E. McKenney
2005-06-11  1:38             ` Eric Piel
2005-06-11  1:47               ` Paul E. McKenney
2005-06-09 23:34 ` Tim Bird
2005-06-09 23:50   ` Paul E. McKenney
2005-06-10  2:59     ` Lee Revell
2005-06-10 15:47       ` Paul E. McKenney
2005-06-10 17:37         ` Andrea Arcangeli [this message]
2005-06-10 19:39           ` Bill Huey
2005-06-10 19:41             ` Lee Revell
2005-06-10 20:26             ` Karim Yaghmour
2005-06-10 22:37               ` Bill Huey
2005-06-10 22:43                 ` Bill Huey
2005-06-10 22:52                 ` Andrea Arcangeli
2005-06-10 23:00                   ` Flames go here (was Re: Attempted summary of "RT patch acceptance" thread) Lee Revell
2005-06-10 23:08                   ` Attempted summary of "RT patch acceptance" thread Bill Huey
2005-06-10 23:29                     ` Andrea Arcangeli
2005-06-11  1:41                       ` Paul E. McKenney
2005-06-11  1:50                         ` Karim Yaghmour
2005-06-11  2:06                           ` Paul E. McKenney
2005-06-11 15:54                         ` Andrea Arcangeli
2005-06-11 21:04                           ` Paul E. McKenney
2005-06-11 23:48                             ` Karim Yaghmour
2005-06-12 17:06                               ` Andrea Arcangeli
2005-06-12 21:45                               ` Paul E. McKenney
2005-06-13  1:35                                 ` Karim Yaghmour
2005-06-13 14:40                                   ` Paul E. McKenney
2005-06-13 19:49                                     ` Karim Yaghmour
2005-06-13 20:03                                       ` Daniel Walker
2005-06-13 20:21                                         ` Paul E. McKenney
2005-06-13 20:26                                         ` Karim Yaghmour
2005-06-13 20:23                                           ` Lee Revell
2005-06-13 20:28                                           ` Daniel Walker
2005-06-13 22:00                                             ` Karim Yaghmour
2005-06-13 22:11                                               ` Karim Yaghmour
2005-06-13 22:18                                                 ` Bill Huey
2005-06-13 22:28                                                   ` Karim Yaghmour
2005-06-13 22:29                                                     ` Bill Huey
2005-06-13 22:55                                                       ` Karim Yaghmour
2005-06-14  1:13                                                         ` Nicolas Pitre
2005-06-14  2:07                                                           ` Karim Yaghmour
2005-06-14  2:35                                                             ` Nicolas Pitre
2005-06-14  2:37                                                               ` Nicolas Pitre
2005-06-14  3:24                                                               ` Karim Yaghmour
2005-06-14 16:41                                                         ` Gerrit Huizenga
2005-06-14 19:20                                                           ` Bill Huey
2005-06-14 19:35                                                             ` Valdis.Kletnieks
2005-06-14 21:29                                                               ` Gene Heskett
2005-06-14 20:19                                                             ` Gerrit Huizenga
2005-06-14  7:00                                               ` Eugeny S. Mints
2005-06-14 16:09                                               ` Gerrit Huizenga
2005-06-14 16:47                                                 ` Andrea Arcangeli
2005-06-13 20:38                                         ` Bill Huey
2005-06-13 20:10                                       ` Paul E. McKenney
2005-06-13 20:31                                         ` Bill Huey
2005-06-13 20:58                                           ` Paul E. McKenney
2005-06-13 20:34                                         ` Karim Yaghmour
2005-06-13 21:02                                           ` Paul E. McKenney
2005-06-12 17:01                             ` Andrea Arcangeli
2005-06-12 18:43                               ` Lee Revell
2005-06-12 19:12                                 ` Bill Huey
2005-06-11  5:23                   ` Ingo Molnar
2005-06-11 17:24                     ` Andrea Arcangeli
2005-06-10 20:22           ` Daniel Walker
2005-06-10 20:45           ` Lee Revell
2005-06-10 21:06             ` Andrea Arcangeli
2005-06-10 22:19               ` Bill Huey
2005-06-10 22:37                 ` Andrea Arcangeli
2005-06-10 22:49                   ` Daniel Walker
2005-06-10 23:01                   ` Bill Huey
2005-06-10 23:05                     ` Andrea Arcangeli
2005-06-10 23:15                       ` Bill Huey
2005-06-10 23:16             ` Paul E. McKenney
2005-06-10 23:26               ` Bill Huey
2005-06-10 23:36                 ` Zwane Mwaikambo
2005-06-10 23:41                   ` Bill Huey
2005-06-10 23:46                     ` Lee Revell
2005-06-11  1:07                 ` Paul E. McKenney
2005-06-11 15:16                   ` Andrea Arcangeli
2005-06-11 20:32                     ` Paul E. McKenney
2005-06-11  0:48           ` Paul E. McKenney
2005-06-10 20:38         ` Lee Revell
2005-06-10 23:12           ` Paul E. McKenney
  -- strict thread matches above, loose matches on Subject: below --
2005-06-08 15:54 Eric Piel
2005-06-09  2:20 ` Paul E. McKenney
2005-06-10 21:58   ` Eric Piel
2005-06-11  1:55     ` Paul E. McKenney
2005-06-13 22:20 Saksena, Manas
2005-06-13 22:42 ` Karim Yaghmour
2005-06-13 22:44   ` Karim Yaghmour
2005-06-13 22:43 ` Bill Huey
2005-06-13 22:43 Saksena, Manas

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=20050610173728.GA6564@g5.random \
    --to=andrea@suse.de \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=bhuey@lnxw.com \
    --cc=bruce@andrew.cmu.edu \
    --cc=dwalker@mvista.com \
    --cc=hch@infradead.org \
    --cc=karim@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=paulmck@us.ibm.com \
    --cc=pmarques@grupopie.com \
    --cc=rlrevell@joe-job.com \
    --cc=sdietrich@mvista.com \
    --cc=tglx@linutronix.de \
    --cc=tim.bird@am.sony.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