Skip to content

[userspace LL] disable VMH, increase heap - #11173

Open
lyakh wants to merge 1 commit into
thesofproject:mainfrom
lyakh:heap
Open

[userspace LL] disable VMH, increase heap#11173
lyakh wants to merge 1 commit into
thesofproject:mainfrom
lyakh:heap

Conversation

@lyakh

@lyakh lyakh commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

VMH uses a hard-coded chunk configuration, which wastes SRAM. We can instead move to use vregions for large allocations, but while vregion use isn't sufficient, we temporarily increase the conventional heap.

VMH uses a hard-coded chunk configuration, which wastes SRAM. We
can instead move to use vregions for large allocations, but while
vregion use isn't sufficient, we temporarily increase the
conventional heap.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

SOF_ZEPHYR_VIRTUAL_HEAP_REGION_SIZE can still default non-zero when VIRTUAL_HEAP is disabled due to VIRTUAL_HEAP_EXTENDED defaulting to y, which undermines the intended SRAM savings.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR aims to reduce wasted SRAM caused by the VMH (virtual heap) hard-coded chunk configuration by disabling virtual heap usage (for PTL userspace-LL overlay) and temporarily increasing the conventional Zephyr heap size to compensate while vregion-based large allocations are still incomplete.

Changes:

  • Increase the default SOF_ZEPHYR_HEAP_SIZE for SOC_ACE30 / SOC_ACE40.
  • Change SOF_ZEPHYR_VIRTUAL_HEAP_REGION_SIZE defaults to be non-zero only when VIRTUAL_HEAP is enabled, otherwise default to 0.
  • Disable VIRTUAL_HEAP in the PTL userspace-LL overlay.
File summaries
File Description
zephyr/Kconfig Adjust heap sizing defaults and virtual-heap-region sizing behavior.
app/overlays/ptl/ll_userspace_overlay.conf Disable virtual heap in PTL userspace-LL overlay configuration.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

# TODO: needs some better solution to allocate
CONFIG_SOF_ZEPHYR_SYS_USER_HEAP_SIZE=0x80000

CONFIG_VIRTUAL_HEAP=n
Comment thread zephyr/Kconfig
Comment on lines 131 to +133
default 0x140000 if VIRTUAL_HEAP_EXTENDED
default 0x100000
default 0x100000 if VIRTUAL_HEAP
default 0x0
@intel-sofci

intel-sofci commented Sep 7, 2026

Copy link
Copy Markdown

PR 11173: test results

Run date: 2026-09-07 12:12 UTC

Tested commit: d98531957849ecb8410324190a5df9b9e1eebd4c

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit msg could be more clear, but change itself is good.

@@ -37,3 +37,5 @@ CONFIG_XRUN_NOTIFICATIONS_ENABLE=n
# enabled and uses the vmh allocation intended for KBP.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"vregion use isn't sufficient" is a bit hard to understand. Maybe something like "During the transition period when vregion is not yet used by all modules, we temporarily increase..."

@kv2019i

kv2019i commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Fuzzer fails are known #11162

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.

4 participants