Re: RFC for a new Scheduling policy/class in the Linux-kernel

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Peter Zijlstra
Date: Tuesday, July 14, 2009 - 2:15 am

On Mon, 2009-07-13 at 11:14 -0700, Noah Watkins wrote:

       C
       |
       L2
      /  \
     B    E
     |    |
     L1   L3
     |    |
     A    D


Right, we too keep the full graph (as Ted has noted with disgust).

Douglas mentions that since there is no priority in things like
proportional bandwidth schedulers (CFS), priority inheritance cannot
work.

I would beg to differ in that a straight forward extension of the
protocol can indeed work, even for such cases.

One needs to change the sorting function used in the waitqueues (Li) to
reflect the full scheduler function (which in itself can be expressed as
a (partial?) sorting function.

One needs to pass along the 'highest' task, not simply the priority.

And, one needs to cancel and re-acquire this task's contention whenever
the leading task (C) gets preempted.

We let the scheduler use and consume the task that is passed up as being
the 'highest' in C's stead (it might actually be C).


For example, suppose the above block graph and add a single unrelated
task F, all of equal and unit (1) weight. Now traditionally that'd
result in 2 runnable tasks of equal weight, such that they both get 50%
cpu time (assuming single cpu).

However, PEP and the above modified PIP will in fact result in C
receiving an effective weight of 5 versus 1 for F.

The sorting function for proportional bandwidth schedulers is the
typical least service received one -- such that the task with least
service will be deemed the 'highest' one.

Now suppose that that task would be found to be A, we'll run C with A's
values until its quanta is consumed and we'd force preempt. Normally
that would lead to the selection of F, however if we first cancel and
retry A, leading to a re-sorting of the graph, we might well find that E
is the 'highest' task in the graph, and also more eligible than F.


Furthermore Ted raises the point:


I hope the above illustrates the use of this, furthermore I think Dario
and team did some actual analysis on it wrt deadline schedulers. Dario
could you expand?

~ Peter

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
RFC for a new Scheduling policy/class in the Linux-kernel, Henrik Austad, (Fri Jul 10, 2:50 pm)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, Douglas Niehaus, (Tue Jul 14, 12:44 am)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, Peter Zijlstra, (Tue Jul 14, 2:15 am)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, James H. Anderson, (Tue Jul 14, 8:19 am)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, James H. Anderson, (Tue Jul 14, 9:54 am)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, James H. Anderson, (Tue Jul 14, 10:16 am)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, James H. Anderson, (Tue Jul 14, 12:33 pm)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, Bjoern B. Brandenburg, (Tue Jul 14, 9:25 pm)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, James H. Anderson, (Thu Jul 16, 5:59 am)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, Karthik Singaram Lak ..., (Thu Jul 16, 3:34 pm)
Re: RFC for a new Scheduling policy/class in the Linux-kernel, Karthik Singaram Lak ..., (Thu Jul 16, 6:44 pm)