Re: [PATCH v4 20/22] rv: Add rtapp_sleep monitor

From: Gabriele Monaco
Date: Thu Apr 24 2025 - 09:56:26 EST


On Wed, 2025-04-23 at 08:50 +0200, Nam Cao wrote:
> Add a monitor for checking that real-time tasks do not go to sleep in
> a
> manner that may cause undesirable latency.
>
> Also change
> RV depends on TRACING
> to
> RV select TRACING
> to avoid the following recursive dependency:
>
>  error: recursive dependency detected!
> symbol TRACING is selected by PREEMPTIRQ_TRACEPOINTS
> symbol PREEMPTIRQ_TRACEPOINTS depends on TRACE_IRQFLAGS
> symbol TRACE_IRQFLAGS is selected by RV_MON_SLEEP
> symbol RV_MON_SLEEP depends on RV
> symbol RV depends on TRACING
>
> Signed-off-by: Nam Cao <namcao@xxxxxxxxxxxxx>
> ---
>

I've been playing with these monitors, code-wise they look good.
I tested a bit and they seem to work without many surprises by doing
something as simple as:

perf stat -e rv:error_sleep stress-ng --cpu-sched 1 -t 10s
-- shows several errors --

perf stat -e rv:error_sleep stress-ng --prio-inv 1 --prio-inv-policy rr
-- shows only 1 error (normal while starting the program?) --

Not quite sound, but does it look a reasonable test to you?

I quickly tried the same with the other monitor comparing the number of
errors with the page_faults generated by perf, but that didn't make too
much sense. Perhaps I'm doing something wrong here though (the number
reported by perf for page faults feels a bit too high).

perf stat -e page-faults -e rv:error_pagefault stress-ng --cyclic 1

Anyway, the monitor looks good to me

Reviewed-by: Gabriele Monaco <gmonaco@xxxxxxxxxx>

but it'd be nice if you have tips to share how to quickly test it (e.g.
without writing a custom workload).

Thanks,
Gabriele