[userspace LL] Scheduling part of #10945 - #11138
Open
lyakh wants to merge 4 commits into
Open
Conversation
lyakh
requested review from
LaurentiuM1234,
abonislawski,
bardliao,
dbaluta,
iuliana-prodan,
kv2019i,
lbetlej,
lgirdwood,
marcinszkudlinski,
mmaka1,
pblaszko,
plbossart and
tmleman
as code owners
August 28, 2026 08:47
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ports parts of the “userspace LL scheduling” work (from #10945) into the main scheduling code, primarily to allow user-space LL execution to trigger DP scheduling and to grant the required kernel object access across cores.
Changes:
- Expose DP scheduler hooks as Zephyr syscalls (notably
scheduler_dp_ll_tick(core)andscheduler_dp_internal_free()), and switch DP scheduler data lookup to the user-scheduler registry. - Wire LL → DP tick propagation with an explicit core parameter.
- Add a helper to retrieve the userspace IPC thread and extend access grants for DP task initialization when
CONFIG_SOF_USERSPACE_LLis enabled.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| zephyr/CMakeLists.txt | Adds DP scheduling header to Zephyr syscall header generation. |
| src/schedule/zephyr_ll.c | Updates DP tick invocation to pass a core ID. |
| src/schedule/zephyr_dp_schedule.h | Removes declarations now expected to come from the public DP schedule header/syscall layer. |
| src/schedule/zephyr_dp_schedule.c | Converts DP tick to a syscall-style implementation and switches to user scheduler data lookup. |
| src/schedule/zephyr_dp_schedule_thread.c | Converts internal free to syscall-style implementation (thread variant) with a verify stub. |
| src/schedule/zephyr_dp_schedule_application.c | Adds IPC-thread access grants and adds syscall verification for internal free (app variant). |
| src/ipc/ipc-common.c | Adds ipc_thread_user(core) accessor for the userspace IPC thread. |
| src/include/sof/schedule/dp_schedule.h | Updates DP scheduler public API to syscall declarations under Zephyr full-app builds. |
| src/include/sof/ipc/common.h | Adds prototype for ipc_thread_user(core). |
Suppressed comments (1)
src/schedule/zephyr_dp_schedule_application.c:641
- scheduler_dp_mod_vrfy() uses assert(alloc) in syscall verification code. If asserts are compiled out, a NULL alloc will be dereferenced, causing a kernel fault during syscall verification.
struct mod_alloc_ctx *alloc = mod->priv.resources.alloc;
assert(alloc);
if (alloc->heap) {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+472
to
+476
| struct ipc *ipc = ipc_get(); | ||
| struct ipc_user *ipc_user = ipc->ipc_user_pdata; | ||
|
|
||
| return ipc_user->thread[core]; | ||
| } |
Comment on lines
159
to
163
| struct task_dp_pdata *pdata = pmod->dev->task->priv_data; | ||
| unsigned int core = pmod->dev->task->core; | ||
| int ret; | ||
|
|
||
| if (!pmod) { |
lyakh
marked this pull request as draft
August 28, 2026 10:16
lyakh
force-pushed
the
sched
branch
3 times, most recently
from
August 28, 2026 12:02
85786db to
3973461
Compare
lyakh
marked this pull request as ready for review
August 28, 2026 12:06
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Suppressed comments (1)
src/schedule/zephyr_dp_schedule.c:392
scheduler_get_task_info_dp()unconditionally usesscheduler_get_user_data(SOF_SCHEDULE_DP)and then dereferencesdp_schwithout a NULL check. WithCONFIG_SOF_USERSPACE_LL=n, DP is registered in the kernel scheduler list, so this can become a NULL dereference.
scheduler_props->processing_domain = COMP_PROCESSING_DOMAIN_DP;
struct scheduler_dp_data *dp_sch = scheduler_get_user_data(SOF_SCHEDULE_DP);
lock_key = scheduler_dp_lock(cpu_get_id());
scheduler_get_task_info(scheduler_props, data_off_size, &dp_sch->tasks);
The DP scheduler runs tasks in userspace mode, it's registered with the user scheduler list, therefore it should use scheduler_get_user_data(), not scheduler_get_data(). Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
scheduler_dp_ll_tick(() has to recalculate DP deadlines and reschedule DP threads. Make it a syscall to be able to call it from the userspace LL scheduler. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Make scheduler_dp_internal_free() a syscall in the "application" DP implementation. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The LL userspace thread has to interact with the DP one. Grant required rights. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of the scheduling changes from the userspace LL PR #10945