Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ config SOF_ZEPHYR_VIRTUAL_HEAP_SIZE
config SOF_ZEPHYR_VIRTUAL_HEAP_REGION_SIZE
hex "Size in bytes of virtual memory region for virtual heap shared for all cores"
depends on MM_DRV_INTEL_ADSP_MTL_TLB
default 0x100000
default 0x180000
help
This config defines size of virtual heap region shared between all cores

Expand Down
3 changes: 2 additions & 1 deletion zephyr/lib/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ static const struct vmh_heap_config static_hp_buffers = {
{ 2048, 8},
{ 4096, 11},
{ 8192, 10},
{ 65536, 3},
{ 32768, 8},
Copy link
Member

Choose a reason for hiding this comment

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

BTW, this is not just an increase in size but also a different configuration of memory blocks. Is this the optimal split?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, new extra 0.5 MB are used to introduce new 32 kB and add more 64 kB blocks. Before this change practical maximum buffer size was 8 kB, as we could only allocate max 5 buffers larger then 8 kB. That number of buffer is usually not enough even for simple topology.

Is this the optimal split?

That's actually the problem with our current implementation: we have to define blocks configuration at compile time and as we have to support formats from 8 kHz to 192 kHz, 1 to 8 channels, 1 ms buffers to 100 ms buffers, there could be a problem to define optimal split. Now half of the memory is sort of "reserved" for KPB buffer -- that seems quite un-optimal.

Maybe the proper solution would be to re-implement virtual heap allocator to eliminate the need to define any blocks at compile time. Similarly like this is currently done for Zephyr heap. But that's not a quick fix.

{ 65536, 7},
{ 131072, 1},
{ 524288, 1} /* buffer for kpb */
},
Expand Down
Loading