From: Esben Nielsen <nielsen.esben@googlemail.com>
To: Jean-Marc Valin <Jean-Marc.Valin@usherbrooke.ca>
Cc: Esben Nielsen <nielsen.esben@googlemail.com>,
Lee Revell <rlrevell@joe-job.com>,
Arjan van de Ven <arjan@infradead.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: Where is RLIMIT_RT_CPU?
Date: Sun, 16 Jul 2006 13:20:40 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0607161254260.9870@localhost.localdomain> (raw)
In-Reply-To: <1153044864.6374.135.camel@idefix.homelinux.org>
On Sun, 16 Jul 2006, Jean-Marc Valin wrote:
>> You can't have "random" users scheduling thing at real-time priorities.
>> A real-time system can only work if it is set up as whole and all
>> real-time tasks are taken into consideration. If you allow a user to start
>> another real-time task, that task might destroy the real-time properties
>> of all the rest by taking too much cpu.
>>
>> As I see it the only thing you can do is to use sudo to run anything,
>> which needs real-time priority, with higher priviliges, than what a normal
>> user have. Then he can only start specific audio programs and can't crash
>> the system (unless those programs have a bug).
>
> I though we were past that point a long time ago. Of course you don't
> want *any* random user to have access to rt scheduling. However, you
> *do* want the user logged-in on the console be allowed to run tasks with
> rt priority (within some limits). Why? Because 1) you don't want to give
> root access to any user who needs RT for some apps and 2) you don't want
> to make all these apps suid root either.
>
Who said suid root? What about suid realtime or suid audio?
> Think about it, would you really feel safe with your sound daemon,
> Ekiga/Gnomemeeting, jackd, Amarok, mplayer, ... all being run setuid
> root. Yet all these apps (and many others) can benefit from being
> allowed a few percent CPU running at rt priority. Not to mention the
> fact that you may actually want to do rt *development* as a regular
> user. That's why people have come up with realtime-lsm, and more
> recently, with SCHED_ISO and rt-limit. What's currently missing is just
> the tiny bit that prevents the user from locking up the machine. Even
> that one was done by Ingo, but unfortunately not merged in the mainline
> kernel. Controlled properly, access to rt scheduling is no more
> dangerous (and probably less) than fork(), malloc() or mlock(), all of
> which can lock up a machine efficiently if unlimited use is allowed.
My point is not that they can lock up the machine. My point is that you
just can't add a rt task to a rt system! A rt-system consists of a fixed
set of threads, which in worst case can meet it's deadlines. If you add
just one task you might break the whole system. Only someone with overview
of the whole system can add those tasks.
It is very simple if you have only a audio application or only a driver
needing low latencies. What if you have both? You have to make sure that
the higher priority one leaves enough cpu for the lower priority one. And
it is not a question of using a low percentage of cpu. It is a question of
how long the cpu is used in one go and how often it can happen within the
critical timeframe of the lower priority application.
You can make a system which checks that but it is much harder to do than
a moving average. The only thing which makes sense is (a) square filter(s)
with a width equal to the required latency of the lower priority task(s).
So the sys-admin should somehow be able to give the right either to
specific (audio) applications with specific priorities or a developer whom
he trusts (and it does not make sense to give it to both as they would
then mess it up for each other!)
We have discussed that total lock-up can be prevented with a simple
watchdog. That solution doesn't need anything added into the scheduler.
Esben
>
> Jean-Marc
>
next prev parent reply other threads:[~2006-07-16 11:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-12 0:23 Jean-Marc Valin
2006-07-13 16:43 ` Lee Revell
2006-07-14 9:39 ` Jean-Marc Valin
2006-07-14 21:31 ` Esben Nielsen
2006-07-14 23:20 ` Jean-Marc Valin
2006-07-15 13:58 ` Lee Revell
2006-07-15 14:19 ` Jean-Marc Valin
2006-07-15 14:42 ` Arjan van de Ven
2006-07-15 15:04 ` Jean-Marc Valin
2006-07-15 15:44 ` Lee Revell
2006-07-16 0:23 ` Jean-Marc Valin
2006-07-16 10:44 ` Esben Nielsen
2006-07-16 10:14 ` Jean-Marc Valin
2006-07-16 12:20 ` Esben Nielsen [this message]
2006-07-17 11:53 ` Jean-Marc Valin
2006-07-17 13:59 ` Steven Rostedt
2006-07-17 14:32 ` Jean-Marc Valin
2006-07-17 15:06 ` Steven Rostedt
2006-07-17 16:18 ` Esben Nielsen
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=Pine.LNX.4.64.0607161254260.9870@localhost.localdomain \
--to=nielsen.esben@googlemail.com \
--cc=Jean-Marc.Valin@usherbrooke.ca \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rlrevell@joe-job.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®