linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Freitas <miguel@cetuc.puc-rio.br>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] SCHED_SOFTRR linux scheduler policy ...
Date: 12 Jul 2003 13:34:32 -0300	[thread overview]
Message-ID: <1058027672.1196.105.camel@mf> (raw)
In-Reply-To: <Pine.LNX.4.55.0307120735540.4351@bigblue.dev.mcafeelabs.com>

Hi Davide,

On Sat, 2003-07-12 at 12:20, Davide Libenzi wrote:
> While I love the new scheduler, it is also true that interactivity comes
> at a price. And this is fairness and predictable latency. It is also true
> that many multimedia application do use very small buffers, that make them
> to require short timings.


I guess you are talking about mostly audio applications here. For video
playback these timings are even tighter and there is very little the
application itself can do to improve it (it's not a matter of increasing
the buffer size).

It is also true that most people won't be running heavy applications
while watching a video. It's not like the xmms that we leave running on
background while working.


> I have to say that on my machine (P4 2.4GHz),
> audio hardly skip during the typical load that my desktop sees, that in
> turn is not so high. Like you can see in the couple of graphs that I
> quickly dropped inside the SOFTRR page, typical latencies of 150ms are
> very easy to obtain.


150ms latency would kill any video application.

There is no equivalent of sound card's or kernel audio buffers for
frames, the application just _have_ to be scheduled in time to display
the frame (basicaly tell X to display a frame from shared memory, for
example).

In xine, we have separated decoder and output threads with a queue of
about 15 frames between them. So just the output thread needs
predictable latency, and that thread does use very little CPU.

Also the problem may get a little worse as people start trying to get
better quality from their systems. I recently added a plugin in xine
(tvtime) that deinterlaces frames to full tv field rate (60Hz). While
playing a DVD @ 30Hz under a 2.4 kernel (HZ=100) is usually acceptable,
60Hz pushes the requirements a little further: the output thread must be
scheduled every 16ms.


> The patch is trivially simple, like you
> can see from the code, and it basically introduces an expiration policy
> for realtime tasks (SOFTRR ones).

yes, i saw that, pretty nice!
i have yet to try it (i don't have any recent 2.5 on my machine)


> Patch acceptance is
> tricky and definitely would need more discussion and test.


Sure. But let me add a voice of support here: I would be great if kernel
provided a way to multimedia or interactive applications to request a
better latency predictability (or hint the scheduler somehow) without
need of being root. If that comes in a form of a new scheduler policy,
or just allowing small negative nice values for non-root i don't mind...


> With the current patch you do not need any special support if you are
> already asking for SCHED_RR policy. If you are not root you will be
> automatically downgraded to SCHED_SOFTRR ;)


We don't currently request SCHED_RR in xine. At least Ingo once adviced
me he didn't thought it was right for a multimedia application to use
that. The problem is that currently we have an all (root can set -nice,
scheduler policy, etc) or nothing situation.
 
regards,

Miguel


  parent reply	other threads:[~2003-07-12 16:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-12 13:43 [patch] SCHED_SOFTRR linux scheduler policy Miguel Freitas
2003-07-12 15:20 ` Davide Libenzi
2003-07-12 15:49   ` Jamie Lokier
2003-07-12 15:59     ` Davide Libenzi
2003-07-12 16:20       ` Jamie Lokier
2003-07-12 16:18         ` Davide Libenzi
2003-07-12 16:41         ` Miguel Freitas
2003-07-12 18:51           ` Jamie Lokier
2003-07-13  1:44             ` Davide Libenzi
2003-07-13 14:11               ` Jamie Lokier
2003-07-13 17:15                 ` Davide Libenzi
2003-07-12 22:42       ` Bill Huey
2003-07-13  2:39         ` Davide Libenzi
2003-07-13  3:59           ` Bill Huey
2003-07-12 16:34   ` Miguel Freitas [this message]
2003-07-12 16:30     ` Davide Libenzi
2003-07-12 19:13       ` Miguel Freitas
2003-07-12 20:07         ` Davide Libenzi
2003-07-12 18:44     ` Jamie Lokier
  -- strict thread matches above, loose matches on Subject: below --
2003-07-10  2:33 Davide Libenzi
2003-07-13 11:50 ` Pavel Machek
2003-07-13 11:53   ` Alan Cox
2003-07-13 16:08   ` Davide Libenzi

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=1058027672.1196.105.camel@mf \
    --to=miguel@cetuc.puc-rio.br \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.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).