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

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


> Hi Jeremy,
>
> So far, I did not experience such a bug or do not remember. I do
> remember havinga bug that raises sometimes when execution partitions
> at a very high rates but as the demos use a very slow rate, I never
> had to deal with it. So,there might be a bug and you are probably
> right. Anyway, be careful also while debugging and inspecting system
> behavior : how did you get these values and how did you check the
> code

mainly with delicate use of printf, but I have a fix now... I'll do some cleanup and send the patch for review

> ? This is only by printing on the console or with a scheduler ?
>
> Can you tell us why Amain starts before the end of B time slot  ?
>

because the first time Amain was stoped, the scheduler would call pok_sched_switch(prev_sp,new_sp) with the idle thread's sp as prev_sp

thus, when B would switch from Bmain to IDLE when Bmain was done, it would restart Amain instead of the idle thread.



In turn, pok_sched_switch was called incorrectly because the partition switching (changing the current_partition global variable) is done in the elect_partition, so before elect_thread is run
so elect_thread would not know that a change of partition has occured and would use the new partition's current_thread field to store the previous context instead of the old partition's

it's a bit complicated to explain, but my patch basically does all the thread/partition switching after the election logic. The election logic is now correctly using the old vs new partition and the policy functions receive the previous thread from the partition that is about to run instead of the "absolute" previous thread that might not belong to the new partition

as I said, patch should be around soon

> Anyway, congratulations for having spotting the bug (if this is one)
> !
> I am sure people such as Laurent Lec would be glad to help or even
> review a patch :D
>

yes, it seems to work for me and i'll run the test suite before sending the patch here, but more eyeballs and all that sort of stuff...

thx

Jérémy

>
>



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