[pok-devel] Problem with the POK scheduler...

[ Thread Index | Date Index | More lists.tuxfamily.org/pok-devel Archives ]


Hello everybody

while debugging a problem with partition initialisation I stumbled on a limitation in the POK scheduler that might be a serious bug... I am trying to find all the ins and outs of that bug but I would likely take any advice...



THE SYMPTOMS

I have two partitions (A and B) with main threads (Amain and Bmain)

A is started and runs Amain
- end of window, Amain isn't done yet
B is started and runs Bmain
Bmain set the partition mode to normal

Bug : immediately Amain starts axecuting again within B's time slot (which isn't over yet)


WHAT IS ACTUALLY HAPPENING

when Amain is executing and is swapped out, it is stored in A.current_thread which is the IDLE_THREAD at this point. As a consequence, when Bmain is done, it runs the idle thread which contains Amain's code

The problem is that pok_sched_elect_partition does the actual partition switching and that confuses the pok_sched_elect_thread function.

the pok_sched_elect_thread function seems to only work properly when a change of partition occurs only if the partition that is being left is running the idle thread.


so...


* is this a design choice ?
* has anybody encountered that ?
* any advice on fixing it ?

I am working on a fix but it's complicated and touches the whole scheduler logic (mainly because of unsafe assumptions with current_thread and prev_current_thread which are assumed to be part of the current partition) so any word of wisdom would be welcome

    Regards

    Jérémy Rosen

fight key loggers : write some perl using vim



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/