schedule: add a function for finding userspace scherulers - #11109
Conversation
scheduler_get_data() only finds scheduler data for kernel mode schedulers. Add a similar function for userspace schedulers. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
There was a problem hiding this comment.
Pull request overview
This PR extends the scheduler data lookup API to support user-managed scheduler instances, and updates the Zephyr LL scheduler code to query the correct scheduler list when userspace LL scheduling is enabled.
Changes:
- Introduce a shared
scheduler_list_get_data()helper for looking up scheduler private data in a given scheduler list. - Add
scheduler_get_user_data()to retrieve scheduler data from the userspace scheduler list. - Update Zephyr LL scheduler helpers to use
scheduler_get_user_data()whenCONFIG_SOF_USERSPACE_LLis enabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/schedule/zephyr_ll.c | Uses the userspace scheduler data accessor when userspace LL scheduling is enabled. |
| src/include/sof/schedule/schedule.h | Adds list-based lookup helper and a userspace scheduler data accessor. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /** | ||
| * Retrieves userspace scheduler's data. | ||
| * @param type SOF_SCHEDULE_ type. | ||
| * @return Pointer to scheduler's data. | ||
| */ | ||
| static inline void *scheduler_get_user_data(uint16_t type) | ||
| { | ||
| return scheduler_list_get_data(*arch_user_schedulers_get(), type); | ||
| } |
|
@lyakh Do you have the updated full series somewhere? I'm wondering where you need this? I remember I dropped variants like these earlier and looked up the data with another method. Maybe won't work for full DP/multicore, but something I'd like to double-check. |
@kv2019i I think it's mentioned in the PR description ;-) |
kv2019i
left a comment
There was a problem hiding this comment.
Oops, in PR description the info was.
scheduler_get_data() only finds scheduler data for kernel mode schedulers. Add a similar function for userspace schedulers.
part of #10945