Repository navigation
Conversation
vregion_set_interim() is called from pipeline_complete() on the
pipeline core, also for the vregions of DP modules on other cores.
It created the interim k_heap right away, so the heap metadata was
written to cached memory on the pipeline core. The first interim
allocation on the module's own core then read stale metadata and
failed, although the heap was empty:
[core 0] vregion.interim_heap_init: creating interim heap: lifetime
used 6784, interim available 13696 at 0xa0212a80
[core 1] src_prepare: comp:0 0x1013 entry
[core 1] vregion.interim_alloc: interim alloc failed for 80 bytes
align 64
[core 1] module_adapter.module_prepare: comp:0 0x1013 error -12:
module specific prepare failed
Make vregion_set_interim() only mark the switch, and create the
interim heap on the next allocation, as the comments already
describe. The allocations after the switch are made on the module's
own core, so the heap metadata is only accessed on that core.
Fixes: 10c8e6b ("lib: vregion: lazy interim heap creation from remaining lifetime space")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
kv2019i
requested review from
abonislawski,
dbaluta,
iuliana-prodan and
lyakh
as code owners
November 27, 2026 16:16
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Existing single-core vregion tests cannot validate the cache-dependent fix; affected multicore hardware is needed to reproduce the cross-core DP prepare failure and confirm heap metadata stays on the allocating core.
No open issues 🎉
What changed in this PR
This PR defers vregion interim heap creation to the first allocation on the module’s core, avoiding stale cached heap metadata when the pipeline and module run on different cores.
Changes:
- Adds a pending flag so
vregion_set_interim()marks the transition without creating the heap. - Initializes the interim heap under the existing lock on the next allocation.
| File | Description |
|---|---|
zephyr/lib/vregion.c |
Tracks the pending transition and moves interim heap initialization to the allocating core. |
Review effort: Balanced
lgirdwood
approved these changes
Nov 27, 2026
PR 11552: test resultsRun date: 2026-11-27 16:45 UTC Tested commit: f69675fc028eac6db094de155a77e82bdcf52b18 |
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.
vregion_set_interim() is called from pipeline_complete() on the pipeline core, also for the vregions of DP modules on other cores. It created the interim k_heap right away, so the heap metadata was written to cached memory on the pipeline core. The first interim allocation on the module's own core then read stale metadata and failed, although the heap was empty:
[core 0] vregion.interim_heap_init: creating interim heap: lifetime
used 6784, interim available 13696 at 0xa0212a80
[core 1] src_prepare: comp:0 0x1013 entry
[core 1] vregion.interim_alloc: interim alloc failed for 80 bytes
align 64
[core 1] module_adapter.module_prepare: comp:0 0x1013 error -12:
module specific prepare failed
Make vregion_set_interim() only mark the switch, and create the interim heap on the next allocation, as the comments already describe. The allocations after the switch are made on the module's own core, so the heap metadata is only accessed on that core.
Fixes: 10c8e6b ("lib: vregion: lazy interim heap creation from remaining lifetime space")