audio: comp_buffer: make allocations from the passed memory context#10951
audio: comp_buffer: make allocations from the passed memory context#10951serhiy-katsyuba-intel wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Updates buffer payload allocation/freeing to honor the passed mod_alloc_ctx, keeping allocations within the module’s memory domain and avoiding crashes during bind processing (notably with userspace DP modules on secondary cores).
Changes:
- Switch payload allocation/free paths to prefer
sof_ctx_alloc/freewhen analloccontext is provided, falling back torballoc_align/rfreeotherwise. - Replace
#ifdef CONFIG_SOF_USERSPACE_LLblocks with runtime selection plus assertions usingIS_ENABLED(CONFIG_SOF_USERSPACE_LL).
5cca57d to
444d490
Compare
|
@serhiy-katsyuba-intel can you respond to copilot, thanks ! |
kv2019i
left a comment
There was a problem hiding this comment.
@serhiy-katsyuba-intel Please check the comment. Marking temporarily with -1
| #else | ||
| rfree(buffer->stream.addr); | ||
| #endif | ||
| assert(!IS_ENABLED(CONFIG_SOF_USERSPACE_LL) || alloc); |
There was a problem hiding this comment.
@serhiy-katsyuba-intel One new concern with this. As noted in review of #10950 , we have additional semantics attached to use of rballoc() in kernel-only SOF builds. Namely this is used to route allocs to virtual heap and we have platform specific sizing of the VMH heaps based on how much rballoc() is used.
To keep the existing VMH split, I added this commti 0eb179b . I wonder if this should be used here as well to replace use of rballoc() in normal LL-in-kernel builds? That would keep these allocs in virtual heap in platforms (e.g. Intel ACE) where it is used.
There was a problem hiding this comment.
Done.
To ensure the buffer is not left outside the module's memory domain, the payload allocation must be made from the supplied context instead of always calling rballoc_align(). This fixes a crash during bind processing when running a test with a userspace DP module on a secondary core. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
444d490 to
bd819cf
Compare
To ensure the buffer is not left outside the module's memory domain, the payload allocation must be made from the supplied context instead of always calling rballoc_align().
This fixes a crash during bind processing when running a test with a userspace DP module on a secondary core.