From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Tomas Glozar <tglozar@redhat.com>
Cc: Daniel Wagner <wagi@monom.org>,
Steven Rostedt <rostedt@goodmis.org>,
Clark Williams <clrkwllms@kernel.org>,
linux-trace-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev
Subject: Re: [PATCH] rtla/timerlat: Lock the memory of the user-space threads
Date: Fri, 13 Nov 2026 10:44:23 +0100 [thread overview]
Message-ID: <20261113094423.xgAx5Goo@linutronix.de> (raw)
In-Reply-To: <CAP4=nvRQE+GKPT1-KgZ4OgcVV7eKqnkURaELutSMgK4T8YAZMg@mail.gmail.com>
On 2026-11-13 10:30:33 [+0100], Tomas Glozar wrote:
> > --- a/tools/tracing/rtla/src/timerlat_u.c
> > +++ b/tools/tracing/rtla/src/timerlat_u.c
> > @@ -15,6 +15,7 @@
> > #include <pthread.h>
> > #include <sys/wait.h>
> > #include <sys/prctl.h>
> > +#include <sys/mman.h>
> >
> > #include "common.h"
> > #include "timerlat_u.h"
> > @@ -69,6 +70,15 @@ static int timerlat_u_main(int cpu, struct timerlat_u_params *params)
> > }
> > }
> >
> > + /*
> > + * Keep the measuring process in memory: the latency it reports
> > + * runs until it is back in user space, and a page fault on the way
> > + * (its code, stack or libc pages reclaimed under memory pressure)
> > + * would count as latency. cyclictest does the same with -m.
> > + */
> > + if (mlockall(MCL_CURRENT | MCL_FUTURE))
> > + err_msg("Could not lock timerlat u memory: %s\n", strerror(errno));
> > +
>
> Can we make this opt-in, gated by a -m/--mlockall option, like cyclictest?
>
> We can add it as a boolean field into struct timerlat_params and pass
> down to struct timerlat_u_params. See e.g. 2ff4464e3283
> ("rtla/osnoise: Add IPI tracking cmdline option") for reference.
Why make this an option? I would prefer a RT task doing the right thing
right away. cyclictest has a history of several options to do the right
thing. Is the reason why lock should be disabled?
Sebastian
prev parent reply other threads:[~2026-11-13 9:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 21:23 [PATCH] rtla/timerlat: Lock the memory of the user-space threads Daniel Wagner
2026-11-13 9:30 ` Tomas Glozar
2026-11-13 9:44 ` Sebastian Andrzej Siewior [this message]
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=20261113094423.xgAx5Goo@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglozar@redhat.com \
--cc=wagi@monom.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox