Adding a new scheduling algorithm to Fiasco.OC

Valentin Hauner valentinhauner at gmx.de
Sun Aug 17 20:51:40 CEST 2014


Hi,

I've solved the problem explained in my mail from August 15th. There was
a bug in my implementation of 'Ready_queue_edf::dequeue' so that a
thread which already finished didn't get removed properly from the queue.

By the way, what's the exact meaning of the attribute named
'_ready_link' in your fp_wfq implementation? As far as I got it, it's
set to 0 if the Sched_context is idle and it's set to the address of the
enqueued Sched_context if it is not idle.

However, the second question in my mail from August 15th is still
relevant:  Shall I enqueue the threads with dbg_id 34 (#hello) and 3e
(#hello2) in the EDF ready queue, too? At the moment, they are ordinary
FP threads.

On 08/11/2014 11:35 PM, Adam Lackorzynski wrote:
> You add
>  l:start({ ..., 
>            scheduler = L4.Env.user_factory:create(L4.Proto.Scheduler, ...),
>          }, ...)
> statements.
> For the fixed-prio type, we add two numbers, giving upper limit and base
>  (e.g. L4.Env.user_factory:create(L4.Proto.Scheduler, 10, 5). However,
> for using this in the lua scripting, you also need to adapt libkproxy.
> So for the start, I'd suggest you use the C/C++ interface and reconfig
> the main thread from the defaults just in your program.
>
> In your case, the numbers used have a different meaning of course.
> Passing them down to the kernel goes via Scheduler::run_thread. There's
> some support for different scheduling parameters in the kernel, you've
> probably seen 'union Sp'. You can probably squeeze it in there.
>   
OK, my goal is to define the type (Fixed_prio or Deadline) for each
thread directly in my LUA script. Depending on the type, it should be
possible to pass the priority respectively the deadline for the thread.

I guess that './l4/pkg/libkproxy/include/scheduler_svr' contains the
code snippet that extracts the information supplied in the LUA script
(lines 92-102, 'case L4_SCHEDULER_RUN_THREAD_OP'). Is that right?

Unfortunately, I cannot find the base priority you mentioned.
Furthermore, the struct 'L4_sched_param_fixed_prio' does not have
attributes for 'affinity.offset' and 'affinity.granularity' that are set
in scheduler_svr.

I've tried your example with an upper limit of 10 and a base priority of
5 for my two tasks created in my LUA script, but the 'pr' column in the
thread list of JDB still shows 1 for #hello and #hello2.

Best regards,
Valentin




More information about the l4-hackers mailing list