{{ message }}
heap: more updates with some fixes.#10114
Merged
Merged
Conversation
Allow the developer to set the maximum heap size so that power savings can be made when full memory is not required for device use cases. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces hard-coded heap size macros with configurable Kconfig options and updates memory allocation APIs and documentation to use flag-based terminology instead of zones.
- Introduce
SOF_ZEPHYR_HEAP_SIZEandSOF_ZEPHYR_VIRTUAL_HEAP_SIZEKconfig options and replaceHEAPMEM_SIZEdefines. - Update allocator and platform memory headers to switch from zone-based to
SOF_MEM_FLAG_*usage. - Refine function signatures, comments, and log messages across modules (alloc, DMA trace, probe, component, Google RTC mock, buffers).
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
Comments suppressed due to low confidence (4)
zephyr/lib/alloc.c:388
- [nitpick] The term 'addresses' may be misleading here; consider using 'memory' to clarify that only cached memory is allowed.
tr_err(&zephyr_tr, "L3_HEAP available for cached addresses only!");
src/audio/buffers/comp_buffer.c:333
- [nitpick] The phrase 'bytes of flags' is awkward; consider changing to 'bytes with flags' for readability.
buf_err(buffer, "resize can't alloc %u bytes of flags 0x%x",
src/audio/buffers/comp_buffer.c:391
- [nitpick] Similar to the earlier log, 'bytes of flags' is confusing; use 'with flags' instead.
buf_err(buffer, "resize can't alloc %zu bytes of flags 0x%x", new_size,
src/include/sof/audio/component.h:323
- [nitpick] The original guidance on using the runtime heap was removed; consider updating this comment to specify the new flag-based allocator (e.g., use
rmallocwith appropriateSOF_MEM_FLAG_*).
*
| help | ||
| SOF userspace modules support will enable modules to run in DP | ||
| processing mode as userspace code and data. This feature is WIP | ||
| and is not yest ready for production, for developers only. |
There was a problem hiding this comment.
Correct the typo 'yest' to 'yet' in the help text.
Suggested change
| and is not yest ready for production, for developers only. | |
| and is not yet ready for production, for developers only. |
| * @param zone Zone to allocate memory from, see enum mem_zone. | ||
| * @param flags Flags, see SOF_MEM_FLAG_... | ||
| * @param caps Capabilities, see SOF_MEM_CAPS_... | ||
| * @param flags Flags, see SOF_MEM_FLAG_.... |
There was a problem hiding this comment.
The ellipsis '....' should use three dots '...' for consistency with other parameter docs.
Allow the developer to set the maximum virtual heap size so that power savings can be made when full memory is not required for device use cases. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add a Kconfig to be used for SOF userspace support. This will be a staging feature at the moment until its stable upstream. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Fix the log messages to show flags instead of type. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Currently the caller checks for allocation failure in the callee. Make the correct function check for allocation failure. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Zone was mentioned in many comments and one log message. Fix this to remove zone references. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Trace and probes were using ZONE macro instead of flags. Fix. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
f6b5e0c to
67b8ba2
Compare
lyakh
approved these changes
Jul 14, 2025
Member
Author
ranj063
approved these changes
Jul 14, 2025
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.

Add Kconfig for heap sizes instead of hard coding and remove all mentions of zone.