Re: [PATCH] tracing/osnoise: Force quiescent states while tracing

From: Nicolas Saenz Julienne
Date: Fri Mar 04 2022 - 10:28:22 EST


Hi Daniel,

On Fri, 2022-03-04 at 15:51 +0100, Daniel Bristot de Oliveira wrote:
> > > Hey Nicolas,
> > >
> > > While testing this patch with rtla osnoise on the 5.17.0-rc6-rt10+, when I hit
> > > ^c on osnoise top, the system freezes :-/.
> > >
> > > Could you try that on your system?
> > Yes of course, I'll get a build going.
>
>
> also, could you try this?

Yes, of course.

> it is an RFC I was thinking to send, as I mentioned before (and on IRC).
>
> It works fine, I see nohz_full and rcu behaving like if osnoise was a
> user-space tool. It is more invasive on osnoise, but the behavior does not
> change - like, run cyclictest on top of osnoise and you will see that
> the system is still preemptive with low latency even with osnoise with
> "preempt_disabled."
>
> do you mind having a look to see if it behaves as expected in your scenario?
>
> [ note, there are things to cleanup in this patch, like adding a static key ]
> [ in is_osnoise_cur(), it was a real RFC. ]
>
> -- Daniel
>
> tracing/osnoise: Pretend to be in user-space for RCU
>
> To simulate an user-space workload, osnoise informs RCU that it
> is going to user-space by calling rcu_user_enter(). However,
> osnoise never actually goes to user-space. It keeps running
> in an intermediate stage.
>
> This stage runs with preemption disabled, like the idle thread
> does. Likewise idle, osnoise will continuously check for need
> resched, allowing its preemption, simulating a fully preemptive
> mode.
>
> Anytime a kernel function needs to be called, the rcu_user_enter()
> needs to be called.
>
> Any change on rcu_user_enter/exit needs to be tested with
> CONFIG_RCU_EQS_DEBUG=y.
>
> Signed-off-by: Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>
> ---

Some comments:
- You're not exiting/entering EQS on IRQ/NMI entry/exit. See
irqentry_{enter,exit}() and irqentry_nmi_{enter,exit}().

- See this series[1], if we ever pursue this approach, it's important we got
through context tracking, instead of poking at RCU directly.

[1] https://lore.kernel.org/lkml/20220302154810.42308-1-frederic@xxxxxxxxxx/T/#t

Regards,

--
Nicolás Sáenz