You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
schedule: bind scheduler to a task at task init time
Change the operation model of schedule.h such that a task is
bound to a scheduler instance at task init time. In the past,
the scheduler instance has been looked up at each task
scheduling invocation. The old model assume all schedule.h callers
have access to all scheduler objects in the system. This complicates
implementation of user-space support in SOF.
Store a pointer to the matching schedule_data in the task struct
at schedule_task_init() time. This allows all schedule API
functions (schedule_task, schedule_task_before, schedule_task_after,
reschedule_task, schedule_task_cancel, schedule_task_free, and
schedule_task_running) to use the cached scheduler reference
directly from task->sch, instead of iterating the global scheduler
list on every call.
This reduces runtime overhead and simplifies the inline functions
in schedule.h, removing the repeated list traversal and type
matching logic. The scheduler binding is validated at init time,
so subsequent operations can assume a valid task->sch pointer.
Note: in Zephyr builds, arch_schedulers_get() is sensitive on which
core it is executed on, so add an assert to ensure schedule_task_init()
is called on the target core.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
0 commit comments