Usage of new virtual heap allocator in SOF/Zephyr architecture #7514
Replies: 1 comment 3 replies
-
Thanks for the write-up. I wonder if we need to extend the alloc.h interface to expose the new semantics to applications. Not sure if the current zone semantics are enough to expose the new capabilities. I.e. RUNTIME_SHARED is currently used to allocate buffers that are used across the cores. On platforms with cached/uncached aliases, this API has returned uncached pointers. But if e.g. per-core heaps are to be created, I don't see other options than to extend alloc.h with some way to applications to indicate that it wants to do an allocation that does not need to be visible to other cores. To get benefits, a large amount of changes would be need to be made to application code to mark places where allocations can be per core, and where they are not. As @lyakh pointed out, we have a lot of generic code that doesn't know whether it is run tied to a single core or not, so this is not necessarily easy interface to use. Also how would you allocate the physical RAM to virtual memory heaps? One big issue we have inow s that we don't know the split between different zones (and we don't want to make a fixed partitioning). How do you plan to tackle this, how is RAM partitioned between system heap and the 1...N virtual heaps? |
Beta Was this translation helpful? Give feedback.
-
Currently in sof/zephyr combo all allocations are made on one heap.
All in \sof\zephyr\lib\alloc.c
With introduction of virtual memory heaps we can start transitioning to using those heaps and benefits they bring.
My idea of implementing this changes is:
Use mem zone attributes as basis for choosing the heap
I want to start by:
If anyone can provide insight please free to do so.
@mmaka1 @marcinszkudlinski Please advice in spare time if my starting points are flawed or should I go with this plan :)
@kv2019i added: Some relevant links to understand context
https://thesofproject.github.io/latest/architectures/firmware/sof-zephyr/rtos_layer/memory_management/heap_sharing.html
https://thesofproject.github.io/latest/architectures/firmware/sof-zephyr/rtos_layer/memory_management/index.html
Beta Was this translation helpful? Give feedback.
All reactions