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

Richi Dubey richidubey at gmail.com
Fri Aug 14 12:28:26 UTC 2020


Hi,

Follow up of my progress to this question:

I 'stepped inside' the important functions to make the observation that the
flow of code is actually:

-------------------------------------

_Scheduler_strong_APA_Node_initialize

_Scheduler_Node_initialize

_Thread_Initialize

rtems_task_create

_RTEMS_tasks_Initialize_user_task

rtems_initialize_executive

boot_card

bsp_start_hook_0_done

-------------------------------------
(So, the thread corresponding to the Init task gets created and assigned a
scheduler node which is then initialized and the Init task is started by
calling rtems_task_start on it)


So, is it okay if I set the Affinity (defined here
<https://github.com/richidubey/rtems/blob/03650c47c537c1acd584c5a9c3db588ab49634ef/cpukit/include/rtems/score/schedulerstrongapa.h#L75>)
of a node to all processors when it gets initialized (here
<https://github.com/richidubey/rtems/blob/03650c47c537c1acd584c5a9c3db588ab49634ef/cpukit/score/src/schedulerstrongapa.c#L739>
) because I remember Mr. Huber telling me earlier that by default a
node/task/thread is allowed to execute on all the processors?




On Fri, Aug 14, 2020 at 3:26 PM Richi Dubey <richidubey at gmail.com> wrote:

> 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/c0efc8e8/attachment.html>


More information about the devel mailing list