Skip to content

Commit b5f1a83

Browse files
committed
userspace: doc: document the scheduler_dp_kick system call
Add scheduler_dp_kick to the syscall map and the LL-only callers, and describe where the DP scheduling calculation runs with user-space DP and LL. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 66f0fbb commit b5f1a83

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎src/include/sof/userspace/README.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ syscall by subsystem:
122122
| CPU | `cpu_get_id` | `sof/lib/cpu.h` | `zephyr/syscall/cpu.c` / `zephyr/lib/cpu.c` |
123123
| Module management | `mod_balloc_align`, `mod_alloc_ext`, `mod_free`, `mod_free_all`, `mod_data_blob_handler_new`, `mod_data_blob_set`, `mod_fast_get` | `sof/audio/module_adapter/module/generic.h` | scattered: `audio/module_adapter/module/generic.c` |
124124
| Library manager | `lib_manager_free_module` | `sof/lib_manager.h` | scattered: `kernel/library_manager/lib_manager.c` |
125-
| Scheduling | `zephyr_ll_task_sem_alloc`, `zephyr_ll_task_sem_free`, `scheduler_dp_internal_free`, `scheduler_dp_ll_tick` | `sof/schedule/ll_schedule_domain.h`, `sof/schedule/dp_schedule.h` | scattered: `kernel/schedule/zephyr_ll-kernel.c`, `kernel/schedule/zephyr_dp_schedule*-kernel.c` |
125+
| Scheduling | `zephyr_ll_task_sem_alloc`, `zephyr_ll_task_sem_free`, `scheduler_dp_internal_free`, `scheduler_dp_ll_tick`, `scheduler_dp_kick` | `sof/schedule/ll_schedule_domain.h`, `sof/schedule/dp_schedule.h` | scattered: `kernel/schedule/zephyr_ll-kernel.c`, `kernel/schedule/zephyr_dp_schedule*-kernel.c` |
126126
| Debug | `debug_stream_slot_send_record` | `user/debug_stream_slot.h` | `kernel/debug/debug_stream/debug_stream_slot.c` |
127127
| KPB | `kpb_notifier_init` | `sof/audio/kpb.h` | scattered: `audio/kpb.c` |
128128

@@ -139,9 +139,15 @@ from user-writable data such as `ipc_user->thread[]`.
139139
|-----------------|----------|
140140
| Any user thread, including DP module threads | `cpu_get_id`, all module management syscalls (`mod_*`), `ipc_msg_send`, `ipc_msg_list_remove`, `send_resource_notif` |
141141
| IPC user thread only | `ipc_compound_pre_start`, `ipc_compound_post_start`, `ipc_wait_for_compound_msg`, `lib_manager_free_module` |
142-
| LL user thread only | `scheduler_dp_ll_tick` |
142+
| LL user thread only | `scheduler_dp_ll_tick`, `scheduler_dp_kick` |
143143
| LL or IPC user thread | all other SOF syscalls |
144144

145+
With `CONFIG_SOF_USERSPACE_APPLICATION`, the DP task list and task memory are writable by DP
146+
threads, so the kernel does not walk them. The DP readiness and deadline calculation runs in
147+
the LL user thread (`scheduler_dp_ll_post_tick()`), which passes its results to
148+
`scheduler_dp_kick()`; the kernel takes the DP thread and event objects from its own task
149+
records. `scheduler_dp_ll_tick` is not built when `CONFIG_SOF_USERSPACE_LL` is also set.
150+
145151
DP modules only get the syscalls needed to implement the module interface. That includes
146152
sending notifications: modules queue messages from `mod_ipc_msg_init()` with
147153
`ipc_msg_send()` and free them with `mod_ipc_msg_free()`, and `dp_task_run()` reports

‎src/schedule/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The DP scheduler (`zephyr_dp_schedule.c`) manages asynchronous, compute-heavy ta
110110
### Architecture
111111

112112
- **Separate Threads**: Unlike LL which multiplexes tasks inside a single thread, **each DP task is assigned its own Zephyr thread**.
113-
- **Wakeup Mechanism**: DP scheduling is evaluated at the end of each LL tick (`scheduler_dp_recalculate()`).
113+
- **Wakeup Mechanism**: DP scheduling is evaluated at the end of each LL tick (`scheduler_dp_recalculate()`). With user-space LL and DP, this runs in the LL user thread and the kernel applies the results with `scheduler_dp_kick()`.
114114
- **Readiness**: It checks if a component has sufficient data across its sinks and sources. If so, it transitions to `RUNNING` and signals the individual DP thread via a Zephyr Event object.
115115
- **Deadlines**: Once ready, the DP thread computes its deadline absolute timestamp (`module_get_deadline()`) and calls `k_thread_absolute_deadline_set()`, submitting to the Zephyr kernel's EDF scheduler.
116116

0 commit comments

Comments
 (0)