Doubt in scheduler SMP function _Scheduler_SMP_Schedule_highest_ready

Gedare Bloom gedare at rtems.org
Tue Aug 4 15:57:45 UTC 2020


On Tue, Aug 4, 2020 at 8:14 AM Richi Dubey <richidubey at gmail.com> wrote:
>
> Hi,
>
> I have a quick doubt about the logic in the else part of the _Scheduler_SMP_Schedule_highest_ready function.
>
I'll give my understanding. Only Sebastian really understands this stuff ;)

> We get the action == SCHEDULER_TRY_TO_SCHEDULE_DO_BLOCK if the node returned by get_highest_ready is already SCHEDULED and has a pinning level of 1 (or <=1). This means that the highest ready eligible node is already scheduled and pinned to a processor.
>
This means that the highest ready node cannot be scheduled right now,
for some reason. It is the thread that is already scheduled, or the
node is busy helping.

> Why do we then change its state to BLOCKED and remove it from the chain of ready nodes?
>
If the thread that owns the node can't be scheduled right now (e.g.,
it is already scheduled on a different node), then the node should be
blocked so we can maybe pick a different node to schedule.

> I would appreciate your help with this.
> Thanks.
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list