From: Philippe Gerum <rpm@xenomai.org>
To: Kevin Strell <kstrell@aerotech.com>
Cc: xenomai@lists.linux.dev
Subject: Re: Xenomai 4 Allocator Fragmentation Questions
Date: Wed, 15 Jul 2026 12:08:39 +0200 [thread overview]
Message-ID: <875x2gmuoo.fsf@xenomai.org> (raw)
In-Reply-To: <CADfsJ_GwXvHioDB_HvGWardrTj_wFJJO-q0QtER42duwZFoi9Q@mail.gmail.com> (Kevin Strell's message of "Tue, 14 Jul 2026 16:44:19 -0400")
Kevin Strell <kstrell@aerotech.com> writes:
> We have been able to avoid the fragmentation problems by switching to
> using the rpmalloc library (https://github.com/mjansson/rpmalloc)
A note regarding this allocator, which documentation reads as follows
under the "Worst case scenarios" section:
"Since each heap maps a span of memory pages per page type, a thread
that allocates just a few blocks of each size class (16, 32, ...) for
many size classes will commit a memory page for each used size class,
while only using a small fraction of the committed memory. However,
memory pages are committed on demand and blocks are initialized only as
needed, ..."
Assuming that "committing pages" may mean mapping them to the current
address space and/or performing some kind of memcontrol work (msync?),
you may want to make sure that rpmalloc can pre-commit pages, so that
this does not happen in time-critical work loops. Because rpmalloc
operates on a per-thread basis, you would need to ensure this for each
thread attached to the evl core specifically. Failing to do so would
certainly cause those real-time threads to be demoted to the in-band
stage. You may want to check this using the related health monitoring
service [1] (EVL_HMDIAG_SYSDEMOTE).
To sum up, rpmalloc addresses the fragmentation issue by dedicating each
memory page to dealing with a particular block size, for allocation
_and_ release, so it does not have to resort to dynamic garbage
collection. However, in order to meet real-time requirements, you may
want to make sure that alloc and release operations won't ever issue a
regular system call under the hood.
[1] https://v4.xenomai.org/core/user-api/thread/index.html#health-monitoring
--
Philippe.
next prev parent reply other threads:[~2026-07-15 10:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-07-27 21:55 ` Bryan Smith
2026-07-28 6:37 ` Philippe Gerum
2026-07-28 13:33 ` Bryan Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875x2gmuoo.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=kstrell@aerotech.com \
--cc=xenomai@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.