audio: module_adapter: use system user heap for allocs#10843
Open
kv2019i wants to merge 1 commit into
Open
Conversation
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>
Collaborator
Author
|
For context, part of #10558 |
Contributor
There was a problem hiding this comment.
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_LLis enabled. - Replace
rmalloc/rzalloc/rballoc/rfreeusages in module adapter paths withsof_heap_alloc/sof_heap_free. - Explicitly zero-initialize
input_buffers/output_buffersarrays after switching away fromrzalloc.
| @@ -101,7 +101,12 @@ static struct processing_module *module_adapter_mem_alloc(const struct comp_driv | |||
| } | |||
| mod_heap = NULL; | |||
Collaborator
Author
There was a problem hiding this comment.
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).
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.
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.