All of lore.kernel.org
 help / color / mirror / Atom feed
* Xenomai 4 Allocator Fragmentation Questions
@ 2026-07-14 20:44 Kevin Strell
  2026-07-15  9:21 ` Philippe Gerum
  2026-07-15 10:08 ` Philippe Gerum
  0 siblings, 2 replies; 6+ messages in thread
From: Kevin Strell @ 2026-07-14 20:44 UTC (permalink / raw)
  To: xenomai

We are currently using Xenomai 4 on an AM69 on our new prototype and
appear to be running into fragmentation issues with the default
allocator while trying to use thread local heaps. After several
seconds of operation our application starts experiencing allocation
failures with evl_alloc_block_unlocked returning NULL. Our heaps are
allocated on reset and we do not extended or otherwise change the size
of the heaps during runtime. The allocated memory in question is
allocated out-of-band and is typically under 100 bytes but
occasionally there are larger allocations. Additionally, we have tried
running the heap_torture test on our platform and the results do not
seem good. Pretty much every test with the +shuffle option is showing
more than 50% fragmentation and many show more than 90%.

We did try the compaction procedure documented on the Xenomai 4
Caveats page but it did not seem to improve our situation. It is
unclear to us when the compaction should be triggered. The
documentation states it needs to happen before mlockall() is called
but evl_init() makes a call to mlockall() and the latter seems like it
needs to be called first.

We have been able to avoid the fragmentation problems by switching to
using the rpmalloc library (https://github.com/mjansson/rpmalloc)
instead of libevl's memory heap services. All that being said, we have
a couple questions about the default Xenomai allocator.

1. Other than the compaction procedure, is there anything we can do
with the default Xenomai allocator to improve the performance in
regards to fragmentation?
2. When is the correct time to run the compaction procedure in regards
to when we should call evl_init()?
3. If the fragmentation is a known issue of the default allocator, is
there any other allocator that is recommended?

Regards,
Kevin Strell

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-28 13:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 20:44 Xenomai 4 Allocator Fragmentation Questions Kevin Strell
2026-07-15  9:21 ` Philippe Gerum
2026-07-15 10:08 ` Philippe Gerum
2026-07-27 21:55   ` Bryan Smith
2026-07-28  6:37     ` Philippe Gerum
2026-07-28 13:33       ` Bryan Smith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.