Skip to content

Conversation

nordic-krch
Copy link
Contributor

Optimizations in DMM that significantly reduces time spent in DMM.

zephyrproject-rtos/zephyr#95306

Add timing measurement to the test to allow DMM profiling.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit f06e050)
Default memcpy used in zephyr is not optimized and performs simple
byte by byte copying. Using double word or word access can significantly
reduce copying time especially for RAM3 (slow peripheral RAM).

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit ff3e018)
Add micro heap implementation which is using one or more 32 bit masks
to allocate quickly blocks. It is significantly better than using
sys_heap. Difference is especially big on RAM3 heap because heap
control data is in RAM3 space so operations there were extremely
slowly (15 us to allocate a buffer).

Simplified implementation of the heap requires DMM API change as
release functions need to know the length of the allocated buffer as
simple heap requires that (buffer address is enough for the standard
heap).

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit decdb30)
Align to API changes.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 8cc4da3)
Add support for getting usage statistics for DMM.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit d10ee98)
Extended test to check usage stats and longer buffer alloc.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit 3d31042)
Add stress test which validates that allocator is thread safe
and has no memory leaks.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit c02f904)
…mory region

Skip stress test if null memory region. That's the case if DMM is
disabled.

Upstream PR #: 96831

Signed-off-by: Krzysztof Chruściński <[email protected]>
There were some corner cases and stress test could fail. Reworking
tail bits handling to make the stress test pass.

Upstream PR #: 96831

Signed-off-by: Krzysztof Chruściński <[email protected]>
@nordicjm nordicjm merged commit 452da84 into nrfconnect:main Oct 7, 2025
17 checks passed
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.

6 participants