Linux Trace Kernel
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: Daniel Wagner <wagi@monom.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Tomas Glozar <tglozar@redhat.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Clark Williams <clrkwllms@kernel.org>
Cc: linux-trace-kernel@vger.kernel.org,
	linux-rt-devel@lists.linux.dev, Daniel Wagner <wagi@monom.org>
Subject: Re: [PATCH] rtla/timerlat: Lock the memory of the user-space threads
Date: Fri, 13 Nov 2026 13:48:18 +0106	[thread overview]
Message-ID: <87qzgox5qt.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <20261112-rtla-mlock-v1-1-418986711b20@monom.org>

Hi Daniel,

On 2026-11-12, Daniel Wagner <wagi@monom.org> wrote:
> diff --git a/tools/tracing/rtla/src/timerlat_u.c b/tools/tracing/rtla/src/timerlat_u.c
> index c80edaf07b00..42aaf1d7f216 100644
> --- a/tools/tracing/rtla/src/timerlat_u.c
> +++ b/tools/tracing/rtla/src/timerlat_u.c
> @@ -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));
> +

Page faulting should happen _before_ the task has a real-time
priority. Real-time priorities are for real-time workloads.

Just move this up 30 lines.

John Ogness

      parent reply	other threads:[~2026-11-13 12:42 UTC|newest]

Thread overview: 7+ 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
2026-11-13 10:07     ` Tomas Glozar
2026-11-13 10:18       ` Sebastian Andrzej Siewior
2026-11-13 11:02   ` Daniel Wagner
2026-11-13 12:42 ` John Ogness [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=87qzgox5qt.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=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