mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Galbraith <efault@gmx.de>
To: Roger Larsson <roger.larsson@skelleftea.mail.telia.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch] SCHED_SOFTRR starve-free linux scheduling policy  ...
Date: Sun, 10 Aug 2003 09:11:00 +0200	[thread overview]
Message-ID: <5.2.1.1.2.20030810084805.01a0dfa8@pop.gmx.net> (raw)
In-Reply-To: <200308100405.52858.roger.larsson@skelleftea.mail.telia.com >

At 04:05 AM 8/10/2003 +0200, Roger Larsson wrote:
>On Saturday 09 August 2003 19.47, Mike Galbraith wrote:
> > At 03:05 PM 8/9/2003 +0100, Daniel Phillips wrote:
> > >Hi Davide,
> > >
> > >On Sunday 13 July 2003 22:51, Davide Libenzi wrote:
> > > > This should (hopefully) avoid other tasks starvation exploits :
> > > >
> > > > http://www.xmailserver.org/linux-patches/softrr.html
> > >
> > >    "We will define a new scheduler policy SCHED_SOFTRR that will make the
> > >    target task to run with realtime priority while, at the same time, we
> > > will enforce a bound for the CPU time the process itself will consume."
> > >
> > >This needs to be a global bound, not per-task, otherwise realtime tasks
> > > can starve the system, as others have noted.
> > >
> > >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.  Dynamic priority adjustment will not put a SCHED_OTHER task above
> > SCHED_RR, SCHED_FIFO or SCHED_SOFTRR, so they won't preempt.  Try
> > this.  Make a SCHED_FIFO task loop, then try to change vt's.  You won't
> > ever get there from here unless you have made 'events' a higher priority
> > realtime task than your SCHED_FIFO cpu hog.  (not equal, must be higher
> > because SCHED_FIFO can't be requeued via timeslice expiration... since it
> > doesn't have one)
> >
> > I do see ~problems with this idea though...
> >
> > 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.
> >
>
>I would prefere to have it as a sub range "min real RT" <SOFT_RR range < mean
>real RT. Using SOFTRR time slice that is inverse proportional with the level
>might also be beneficial.

Yes, if there are more than one running, you reduce scheduler latency.  It 
seems to me that it would also be useful to include short term cpu history 
into priority scaling, such that if a task starts consuming it's slice, it 
would be quickly detected, and that task would only be able to dork up 
others latency requirements for a slice or two before being demoted.

> > 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.
>
>Why shouldn't it be useful with video, is a frame processing burst longer 
>than
>a time slice? The rule for when to and how to revert a SCHED_SOFTRR can be
>changed.

Everything I've seen says "you need at least a 300Mhz cpu to decode".  My 
little cpu is 500Mhz, so I'd have to make more than half of my total 
computational power available for SCHED_SOFTRR tasks for video decode in 
realtime to work.  Even on my single user box, I wouldn't want to have to 
fight for cpu because some random developer decided to use 
SCHED_SOFTRR.  If I make that much cpu available, someone will try to use 
it.  Personally, I think you should need authorization for even tiny 
amounts of cpu at this priority.

         -Mike 


  parent reply	other threads:[~2003-08-10  7:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.55.0307131442470.15022@bigblue.dev.mcafeelabs.c om>
2003-07-14  7:11 ` Mike Galbraith
2003-07-13 21:51   ` 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
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 [this message]
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
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=5.2.1.1.2.20030810084805.01a0dfa8@pop.gmx.net \
    --to=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roger.larsson@skelleftea.mail.telia.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®