linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@osdl.org>
Cc: karim@opersys.com, paulmck@us.ibm.com,
	linux-kernel@vger.kernel.org, rpm@xenomai.org
Subject: Re: [RFC][PATCH] Restricted hard realtime
Date: Wed, 27 Oct 2004 10:10:44 +0200	[thread overview]
Message-ID: <20041027081044.GA14451@elte.hu> (raw)
In-Reply-To: <20041026212956.4729ce98.akpm@osdl.org>


* Andrew Morton <akpm@osdl.org> wrote:

> I have a sneaking suspicion that the day will come when we get nice
> sub-femtosecond latencies in all the trivial benchmarks [...]

with -RT-V0.3 i get lower than 20 usec _maximum_ latencies during
'./hackbench 20'. (the average latency is 1 usec) So while i'm not yet
in the sub-femtosecond category, things are looking pretty good in
PREEMPT_REALTIME land :)

> [...] but it turns out that the realtime processes won't be able to
> *do* anything useful because whenever they perform syscalls, those
> syscalls end up taking long-held locks.

this is not really a problem for the following reason: the spinlock
lock-breaks i am doing for !PREEMPT_REALTIME are exactly the kind of
latencies that could interact with a hard-RT task. What becomes a
latency reducer for the normal SMP or desktop kernel is _the_ latency
guarantee for using arbitrary kernel services in the PREEMPT_REALTIME
model.

another step is to make kernel subsystems have constant overhead (O(1)),
i'd say that's mostly true already today, and it's increasingly becoming
true in the future.

also, RT applications rarely hit the really complex kernel subsystems
because 'complex' often means 'has the potential for IO' - on any
hard-RT OS. So what is important are two factors:

 1) preempt to the RT app immediately

 2) do not create locking interactions between a tasks that use 
    'isolated resources'

#1 is quite good in PREEMPT_REALTIME, and even #2 is largely true for 
it. But RT apps will try to stay isolated anyway, they do an mlockall()
and use simple syscalls.

note that #2 means: 'no big locks', which is a natural scalability
desire anyway.

> Which does lead me to suggest that we need to identify the target
> application areas for Ingo's current work and confirm that those
> applications are seeing the results which they require.  Empirical
> results from the field do seem to indicate success, but I doubt if
> they're sufficiently comprehensive.

with the -V series of PREEMPT_REALTIME the 'preemption latency' target
is easy to meet, because in essence everything except the core scheduler
and the irq redirection code is preemptible :)

E.g. the innermost loop of the IDE hardirq is preemptible, the innermost
loop of kswapd is preemptible and PREEMPT_REALTIME can preempt the
pagefault handler and the mouse handler - name any code and it's
preemptible.

the API latency target is not a big issue because the 'locking
independence' requirement (#2 above) directly corresponds to 'good
scalability on SMP and NUMA'. So anytime we improve high-end scalability
we often will also improve the API-latencies of PREEMPT_REALTIME!

(of course this is a much simplified reasoning ignoring a few issues.)

	Ingo

  reply	other threads:[~2004-10-27  8:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-23 19:47 [RFC][PATCH] Restricted hard realtime Paul E. McKenney
2004-10-23 20:17 ` Ingo Molnar
2004-10-23 20:29   ` Paul E. McKenney
2004-10-24 18:18   ` Paul E. McKenney
2004-10-25 12:26     ` Dimitri Sivanich
2004-10-23 20:22 ` Thomas Gleixner
2004-10-23 21:24   ` Paul E. McKenney
2004-10-23 22:06     ` Jon Masters
2004-10-24 15:32       ` Paul E. McKenney
2004-10-24 21:08         ` Jon Masters
2004-10-24 21:23           ` Ingo Molnar
2004-10-24 21:49             ` Jon Masters
2004-10-24 21:52           ` Paul E. McKenney
2004-10-27  3:16 ` Karim Yaghmour
2004-10-27  4:29   ` Andrew Morton
2004-10-27  8:10     ` Ingo Molnar [this message]
2004-10-28 11:59       ` Karim Yaghmour
2004-10-28 13:16         ` Ingo Molnar
2004-10-28 11:54     ` Karim Yaghmour
2004-10-28 13:04       ` john cooper
2004-10-27 22:35   ` Bill Huey

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=20041027081044.GA14451@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=karim@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@us.ibm.com \
    --cc=rpm@xenomai.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;
as well as URLs for NNTP newsgroup(s).