Skip to content

audio: module_adapter: use system user heap for allocs#10843

Open
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-module-adapter-userspace
Open

audio: module_adapter: use system user heap for allocs#10843
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-module-adapter-userspace

Conversation

@kv2019i
Copy link
Copy Markdown
Collaborator

@kv2019i kv2019i commented Jun 4, 2026

When SOF is built with LL pipes in user-space, module adapter should allocate all resources from the user system heap. Add support for this by modifying allocs to use sof_heap_alloc() and initialize the heap with sof_sys_user_heap_get(). This will return a user-space heap in case SOF is built with CONFIG_SOF_USERSPACE_LL.

When SOF is built with LL pipes in user-space, module adapter should
allocate all resources from the user system heap. Add support for
this by modifying allocs to use sof_heap_alloc() and initialize
the heap with sof_sys_user_heap_get(). This will return a user-space
heap in case SOF is built with CONFIG_SOF_USERSPACE_LL.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i requested a review from ranj063 as a code owner June 4, 2026 12:36
Copilot AI review requested due to automatic review settings June 4, 2026 12:36
@kv2019i
Copy link
Copy Markdown
Collaborator Author

kv2019i commented Jun 4, 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 updates the SOF module adapter to allocate module-adapter-owned resources from the system “user” heap when SOF is built to run LL pipelines in user-space (CONFIG_SOF_USERSPACE_LL). This aligns module adapter allocations with the user-space execution/memory access model by switching relevant allocations to sof_heap_alloc() and using sof_sys_user_heap_get() for heap selection.

Changes:

  • Select the LL user heap for module adapter allocations when CONFIG_SOF_USERSPACE_LL is enabled.
  • Replace rmalloc/rzalloc/rballoc/rfree usages in module adapter paths with sof_heap_alloc/sof_heap_free.
  • Explicitly zero-initialize input_buffers/output_buffers arrays after switching away from rzalloc.

@@ -101,7 +101,12 @@ static struct processing_module *module_adapter_mem_alloc(const struct comp_driv
}
mod_heap = NULL;
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.

This is valid, but the USERSPACE_LL build doesn't yet support the DP usage, so this is not the only problem that would be faced. So I think better to leave it like now and not add steps to DP support (that we know already now are incomplete).

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.

2 participants