Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new src/schedule/README.md describing SOF’s scheduling architecture and the roles/interactions of the LL, DP, and TWB schedulers within the Zephyr-based implementation.
Changes:
- Introduces an overview of the three scheduler types (LL/DP/TWB) and their intended workloads.
- Adds architecture and state-diagram documentation (Mermaid) for each scheduler.
- Documents high-level interactions between scheduler domains and Zephyr threads/timers/interrupts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/schedule/README.md
Outdated
| - **Post-Run**: After all tasks execute, it triggers a `NOTIFIER_ID_LL_POST_RUN` event. This event cascades to wake up other dependent schedulers like DP and TWB. | ||
|
|
There was a problem hiding this comment.
This section states the LL scheduler always triggers NOTIFIER_ID_LL_POST_RUN, but in src/schedule/zephyr_ll.c the notifier is compiled out when CONFIG_SOF_USERSPACE_LL is enabled. Please clarify that this post-run event is conditional (or document the userspace equivalent path, if any).
Add some information about the different schedulers. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
8a8da00 to
c8c1780
Compare
kv2019i
left a comment
There was a problem hiding this comment.
One note inline, but otherwise looks good.
| - **Domain Threads**: The LL scheduler runs within a dedicated high-priority Zephyr thread (`ll_thread0`, etc.) pinned to each core (`zephyr_domain.c`). | ||
| - **Triggers**: It is woken up by a hardware timer (e.g., a 1ms tick) or directly by hardware DMA interrupts (`zephyr_dma_domain.c`). | ||
| - **Execution**: Once woken up, it locks the domain, iterates through all scheduled tasks in priority order, moves them to a temporary list, and calls their `.run()` functions. | ||
| - **Post-Run**: After all tasks execute, it triggers a `NOTIFIER_ID_LL_POST_RUN` event. This event cascades to wake up other dependent schedulers like DP and TWB. Event not run on LL userspace configuration. |
There was a problem hiding this comment.
This is describing work-in-progress limitations of the LL userspace configuration. Not sure if this should be left in the toplevel documentation.
There was a problem hiding this comment.
Ack, will be a good test for AGENTS.md, which copilot should also respect (soon I hope) when reviewing.
Add some information about the different schedulers.