public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: Mike Galbraith <efault@gmx.de>
Cc: Davide Libenzi <davidel@xmailserver.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] SCHED_SOFTRR starve-free linux scheduling policy   ...
Date: Sun, 10 Aug 2003 16:46:34 +0100	[thread overview]
Message-ID: <200308101646.34830.phillips@arcor.de> (raw)
In-Reply-To: <5.2.1.1.2.20030810080748.019cb090@pop.gmx.net>

On Sunday 10 August 2003 07:41, Mike Galbraith wrote:
> At 01:41 AM 8/10/2003 +0100, Daniel Phillips wrote:
> >On Saturday 09 August 2003 18:47, Mike Galbraith wrote:
> > > > But the patch has a much bigger problem: there is no way a SOFTRR task 
> > > > can be realtime as long as higher priority non-realtime tasks can preempt
> > > > it. The new dynamic priority adjustment makes it certain that we will
> > > > regularly see normal tasks with priority elevated above so-called
> > > > realtime tasks.  Even without dynamic priority adjustment, any higher
> > > > priority system task can unwttingly make a mockery of realtime
> > > > schedules.
> > >
> > > Not so.
> >
> >Yes so.  A SCHED_NORMAL task with priority n can execute even when a
> >SCHED_FIFO/RR/SOFTRR task of priority n-1 is ready.  In the case of FIFO
> > and RR we don't care because they're already unusable by normal users but
> > in the case of SOFTRR it defeats the intended realtime gaurantee.
>
> No, _not_ so.  How is the SCHED_NORMAL (didn't that used to be called
> SCHED_OTHER?)

That was just me learning the (funky) terminology.

> task ever going to receive the cpu when a realtime task is
> runnable given that 1. task selection is done via sched_find_first_bit(),
> and 2. realtime queues reside at the top of the array?

OK, got it.  I'd overlooked the strict separation into realtime and
timesliced bands somehow.

> > > Dynamic priority adjustment will not put a SCHED_OTHER task above
> > > SCHED_RR, SCHED_FIFO or SCHED_SOFTRR, so they won't preempt.
> >
> >Are you sure?  I suppose that depends on the particular flavor of dynamic
> >priority adjustment.  The last I saw, dynamic priority can adjust the task
> >priority by 5 up or down.  If I'm wrong, please show me why and hopefully
> >point at specific code.
>
> See the definition of rt_task() in sched.c, and the comments in sched.h
> beginning at line 266.

OK, I believe you now, and this is good, as my fear of high-priority
SCHED_OTHER tasks getting in the way of SOFTRR tasks was bogus. So lets
go back and look at your two concerns:

> 1.  SCHED_SOFTRR tasks can disturb (root) SCHED_RR/SCHED_FIFO tasks as is.
> SCHED_SOFTRR should probably be a separate band, above SCHED_OTHER, but
> below realtime queues.

Nobody promises that root's SCHED_RR/FIFO tasks can get any particular share
of the cpu, only that they will get some CPU provided that all higher-priority
tasks play nicely.  Normal users can take advantage of this hospitality by
taking up to a certain, administer-configured share of the CPU for their own
dark purposes.  Everything is roses and cherries, we haven't broken any rules,
and there's no DoS here.  (Assuming we change the realtime CPU bound to be
global instead of task-local.)

> 2.   It's not useful for video (I see no difference between realtime
> component of video vs audio), and if the cpu restriction were opened up
> enough to become useful, you'd end up with ~pure SCHED_RR, which you can no
> way allow Joe User access to.  As a SCHED_LOWLATENCY, it seems like it
> might be useful, but I wonder how useful.

It's perfectly usable for video, though the administrator may have to
configure a considerably larger share of the cpu for SOFTRR in that case,
especially if a software codec is being used.  I don't see any reason why
the administrator of a single-user system could not make 95% of it available
for realtime media.  The remaining 5% will still be more than a 486 (probably)
which is enough to take care of all the things that the system absolutely
needs to take care of.

That said, I'm only interested in audio at the moment.  If everything works
out, it will be a non-change to use it for video as well.

Regards,

Daniel


  reply	other threads:[~2003-08-10 15:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-13 21:51 [patch] SCHED_SOFTRR starve-free linux scheduling policy Davide Libenzi
2003-08-09 14:05 ` Daniel Phillips
2003-08-09 17:47   ` Mike Galbraith
2003-08-09 23:58     ` Daniel Phillips
2003-08-10  6:06       ` Mike Galbraith
2003-08-10  0:41     ` Daniel Phillips
2003-08-10  6:41       ` Mike Galbraith
2003-08-10 15:46         ` Daniel Phillips [this message]
2003-08-10 17:49           ` Mike Galbraith
2003-08-10 20:28             ` Daniel Phillips
2003-08-11  5:31               ` Mike Galbraith
2003-08-11 13:54               ` Takashi Iwai
2003-08-10  2:05     ` Roger Larsson
2003-08-10  5:43       ` Nick Piggin
2003-08-10  7:41         ` Mike Galbraith
2003-08-10  7:56           ` Nick Piggin
2003-08-10  8:18             ` Mike Galbraith
2003-08-10  9:19               ` jw schultz
2003-08-11 17:01         ` Roger Larsson
2003-08-11 17:25           ` Takashi Iwai
     [not found]     ` <200308100405.52858.roger.larsson@skelleftea.mail.telia.com >
2003-08-10  7:11       ` Mike Galbraith
2003-08-12  7:23         ` Rob Landley
2003-08-12 23:35         ` Pavel Machek
2003-08-13  6:26           ` Mike Galbraith
2003-08-13  9:41             ` Pavel Machek
     [not found] <Pine.LNX.4.55.0307131442470.15022@bigblue.dev.mcafeelabs.c om>
2003-07-14  7:11 ` Mike Galbraith
2003-07-14  7:12   ` Davide Libenzi
2003-07-14  7:24   ` Jamie Lokier
2003-07-14  7:35     ` Davide Libenzi
2003-07-14  9:11     ` Mike Galbraith
     [not found]   ` <Pine.LNX.4.55.0307140004390.3435@bigblue.dev.mcafeelabs.co m>
2003-07-14  8:14     ` Mike Galbraith
2003-07-14 15:09       ` Davide Libenzi
     [not found]       ` <Pine.LNX.4.55.0307140805220.4371@bigblue.dev.mcafeelabs.co m>
2003-07-14 16:06         ` Mike Galbraith
2003-07-14 17:22           ` Davide Libenzi
     [not found]           ` <Pine.LNX.4.55.0307141015010.4828@bigblue.dev.mcafeelabs.co m>
2003-07-15  4:56             ` Mike Galbraith
2003-07-15 15:47               ` 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=200308101646.34830.phillips@arcor.de \
    --to=phillips@arcor.de \
    --cc=davidel@xmailserver.org \
    --cc=efault@gmx.de \
    --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