Need help in figuring out how a node gets its afffinity when it is created

Richi Dubey richidubey at gmail.com
Fri Aug 14 09:56:22 UTC 2020


Hi,

My code is failing because its logic assumed (code here
<https://github.com/richidubey/rtems/blob/03650c47c537c1acd584c5a9c3db588ab49634ef/cpukit/score/src/schedulerstrongapa.c#L315>)
that it would never get a node with an empty affinity (i.e. no affinity to
any processor or a 0 affinity). This assumption proved wrong as I can see
from the gdb and the current flow of code observed is:

------------------------------------------------
_Scheduler_strong_APA_Get_lowest_scheduled

_Scheduler_SMP_Enqueue

_Scheduler_strong_APA_Enqueue

_Scheduler_SMP_Unblock

_Scheduler_strong_APA_Unblock

_Scheduler_Unblock

_Thread_Clear_state_locked

_Thread_Start

rtems_task_start

_RTEMS_tasks_Initialize_user_task

rtems_initialize_executive

boot_card

bsp_start_hook_0_done
----------------------------------------------------

Why is this happening? The Affinity variable (defined here
<https://github.com/richidubey/rtems/blob/03650c47c537c1acd584c5a9c3db588ab49634ef/cpukit/include/rtems/score/schedulerstrongapa.h#L75>)
gets set whenever the Set affinity operation corresponding to Strong_APA
scheduler (defined here
<https://github.com/richidubey/rtems/blob/03650c47c537c1acd584c5a9c3db588ab49634ef/cpukit/score/src/schedulerstrongapa.c#L770>)
gets called. So, why wasn't this function called before this happened? Any
help would be appreciated.

Thanks,
Richi.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200814/935f3401/attachment.html>


More information about the devel mailing list