[LITMUS^RT] How to handle the blocked task
shijunjie92
shijunjie92 at gmail.com
Fri Oct 7 12:14:14 CEST 2016
Hello:
Druing the implementation of the MrsP. I need to build the ceiling for each cpu. All the tasks' priority lower than the ceiling are not allowed to execute. So the following situation may occur: one task holds the ceiling but is blocked by waiting resource. There are some normal tasks which are not waiting for resource in that cpu. They are not allowed to execute because their's priorities are lower than the ceiling. That means this cpu is idle eventhough there are some tasks are ready to execute. In that situation, how can I deal with the logic inside the pfp_schedule(). Can I set the next as NULL to set the cpu in idle state?
Another question is about the cpu_ceiling. In the multiprocessor environment, different semaphores can be allocated to different processors, which can update the loacl cpu ceiling. How can I deal with such data transmission between different semaphore and different processors? Add the structure mrsp_semaphore and mrsp_state into the pfp_domain_t or you have other effective solution?
Best Wishes!
You Sincerely!
2016-10-07
shijunjie92
发件人:Björn Brandenburg <bbb at mpi-sws.org>
发送时间:2016-10-04 11:33
主题:Re: [LITMUS^RT] How to handle the blocked task
收件人:"litmus-dev"<litmus-dev at lists.litmus-rt.org>
抄送:
> On 03 Oct 2016, at 16:00, shijunjie92 <shijunjie92 at gmail.com> wrote:
>
> So how can I let a task spinning on the processor when it is waiting for a resource rather than being preempted by a lower priority task?
> 1. Enqueue that blocked task in the ready queue and pick up the highest priority task as the next scheduled task
> 2. Let an 'empty' thread occupy the processor in the blocked task's priority to protect the process occupied by lower priority task
> Which solution should I take? Could you give me some suggestion?
>
I’m not sure I understand. If a task is spinning, it can't be suspended, so it will be in the ready queue. If it is truly blocked, then it is not spinning and must not be in the ready queue.
If you want to keep around pointers to suspended tasks in the scheduler’s data structures, then make sure you clear those pointers if the task happens to terminate while it is suspended.
- Björn
_______________________________________________
litmus-dev mailing list
litmus-dev at lists.litmus-rt.org
https://lists.litmus-rt.org/listinfo/litmus-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20161007/fd5e8977/attachment.html>
More information about the litmus-dev
mailing list