From: Jean-Marc Valin <Jean-Marc.Valin@USherbrooke.ca>
To: Esben Nielsen <nielsen.esben@googlemail.com>
Cc: 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: Mon, 17 Jul 2006 21:53:00 +1000 [thread overview]
Message-ID: <1153137181.24228.16.camel@idefix.homelinux.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0607161254260.9870@localhost.localdomain>
> Who said suid root? What about suid realtime or suid audio?
Still, I don't see what you gain by making them setuid $group vs
allowing member(s) of $group to use rt scheduling.
> 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.
This issue can also happen if you start 10 suid rt apps. It's the
responsibility of the user to make sure there's no bad interaction. The
reason we want a limit is to make sure the system remains relatively
responsive (not just up). In the ideal case (not sure it's possible),
the scheduler would make sure that non-root rt apps wouldn't get (on
average) more CPU than they would get running at normal priority. i.e.
if there are 3 tasks competing and you start a rt task, then that task
couldn't get more than 25% CPU. Of course, it may not be possible to do
that perfectly, but anything remotely close would be pretty good.
In any case, most audio (and probably other) applications tend to only
require a very small amount (<10%) of CPU to run properly. I'd be quite
happy is my system was configured to allow me to run rt tasks as long as
the total doesn't exceed 30% CPU.
> 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.
I understand that, but adding artificial restrictions (to setuid audio
apps) isn't going to help.
> 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).
Why not? It could be nice as well if someone wants to implement that.
I'd already be quite happy to just have basic control on the CPU time.
> 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!)
How about simply giving rt rights to whomever is logged on the console?
That's the user that really counts since he's (usually) next to the
audio device.
> We have discussed that total lock-up can be prevented with a simple
> watchdog. That solution doesn't need anything added into the scheduler.
As I mentioned earlier, it's not about total lock-up, but having things
run relatively smoothly and (if possible?) even fairly.
Jean-Marc
next prev parent reply other threads:[~2006-07-17 11:53 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
2006-07-17 11:53 ` Jean-Marc Valin [this message]
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=1153137181.24228.16.camel@idefix.homelinux.org \
--to=jean-marc.valin@usherbrooke.ca \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nielsen.esben@googlemail.com \
--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®