Adding a new scheduling algorithm to Fiasco.OC

Valentin Hauner valentinhauner at
Thu Aug 7 15:43:20 CEST 2014


On 08/05/2014 10:59 PM, Adam Lackorzynski wrote:
> Anyway, left() tells the generic code how long a
> thread still has time to run. I think you'll also have a value to put
> in there, at least it should be known at which point in time a
> reevaluation of the situation should be done.
OK, that makes sense. But there's still a problem: The scheduling
mechanisms in Fiasco.OC (even those that are independent of any concrete
scheduling algorithm) are timeslice-based, e.g. the method expired() in
timeslice_timeout.cpp calls the requeue method of the ready queue:
In the original fixed priority algorithm, the current context is
requeued and rotated to the end (!) of the queue by the following line
of code (in ready_queue_fp.cpp):
> prio_next[i->prio()].rotate_to(*++List::iter(i));

That makes sense in a timeslice based round robin scheduler, where the
threads are executed by turns. But it does not make sense for EDF where
the ready queue has to be sorted by deadlines in ascending order.
Removing the line mentioned above from my EDF implementation stops the
execution of the whole system: The last message I see on screen is
> SIGMA0: Hello!
Obviously, sigma0 is a regular, periodic task and is scheduled together
with my example tasks. So no other task than sigma0 comes to execution,
as no round robin mechanism takes place.
What's your suggestion to fix this?

My second question is a short one: How can I pass individual arguments
for my example tasks to the L4 system, e.g. individual deadlines? Each
Sched_context object has a deadline attribute that is initialized to a
default value at the moment.
The following LUA script starts the two tasks hello1 and hello2:
>-- Include L4 functionality
>-- Some shortcut for less typing
>local l = L4.default_loader;
>l:start({ caps = { },
>           log = { "hello1", "blue" } },
>         "rom/hello1");
>l:start({ caps = { },
>           log = { "hello2", "green" } },
>         "rom/hello2");

Where can I pass my deadlines here?

Thanks again for your support!

Best regards,
Valentin Hauner

More information about the l4-hackers mailing list