Skip to content

zephyr: schedule: allow user-space to access scheduler list#10820

Open
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202605-expose-schedulers-list
Open

zephyr: schedule: allow user-space to access scheduler list#10820
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202605-expose-schedulers-list

Conversation

@kv2019i
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i commented May 28, 2026

Make the scheduler list available to system user-space threads.

Make the scheduler list available to system user-space threads.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented May 28, 2026

For context, part of #10558

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the per-core scheduler list pointer array available to Zephyr “system user-space” threads by placing it into a user-accessible app memory partition.

Changes:

  • Add Zephyr userspace helper include to access app-memory placement macros.
  • Place the _schedulers array into the sysuser_partition BSS via APP_SYSUSER_BSS.

Comment thread zephyr/schedule.c
Comment on lines +13 to +17
#include <rtos/userspace_helper.h>
#include <sof/lib/cpu.h>
#include <ipc/topology.h>

static struct schedulers *_schedulers[CONFIG_CORE_COUNT];
static APP_SYSUSER_BSS struct schedulers *_schedulers[CONFIG_CORE_COUNT];
Copy link
Copy Markdown
Collaborator

@lyakh lyakh May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are all schedulers going to run in userspace? E.g. we still have EDF and it's still used by, e.g. kpb. As long as the privileged mode uses this, seems rather risky to me to let userspace overwrite it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lyakh That is the goal. This does leave a gap currently with EDF. Ideally, the SOF schedule.h will only handle audio application logic (how to schedule audio pipelines), while the lower level scheduling is moved to Zephyr. We do have some remaining work to do, especially with EDF used for IPC task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants