Skip to contentSkip to conversation

tracing: irq_pipeline: skip RCU check if oob

DISCUSSION Jan Kiszka 2 participants 2 messages Apr 14, 2023 – Apr 16, 2023

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Philippe,

I just found changes like [1] in dovetail, something I did for I-pipe as well [2]. But, as I wrote in the I-pipe commit, there it was laziness combined with carefulness. I don't think we need that laziness at least in dovetail and fix that issue properly (rcu_nmi_enter/exit on oob entry/exit?). Or what were your thoughts?

Jan

[1]
https://source.denx.de/Xenomai/linux-dovetail/-/commit/3656186a1d544274bd9a468902d2010b8b67f86c
[2]
https://source.denx.de/Xenomai/ipipe-x86/-/commit/005d9b97b2144b32e92063f40a8d65fe03f6b6eb

Signature · 2 lines
Siemens AG, Technology
Competence Center Embedded Linux
#1 lore raw
Quoted 7 lines · Jan Kiszka

Hi Philippe,

I just found changes like [1] in dovetail, something I did for I-pipe as well [2]. But, as I wrote in the I-pipe commit, there it was laziness combined with carefulness. I don't think we need that laziness at least in dovetail and fix that issue properly (rcu_nmi_enter/exit on oob entry/exit?). Or what were your thoughts?

Currently, when running oob, RCU is forced to watch by rcu_read_lock() which calls ct_nmi_enter() as its prologue, hence the laziness in the tracepoint.

But, this somewhat defeats the "lightest-weight conceivable read-side primitives" mantra of RCU, this looks more of a workaround than a fix, so I'm not happy with that stuff. We should rather make the inband kernel consider the oob context on a CPU as an ongoing read-side critical section RCU-wise, just like common preemption-disabled sections are these days. This would have two upsides:

- making all these oob-specific exceptions to checking that RCU is watching plain useless, by telling RCU to _always_ watch an oob context as an ongoing NMI, not solely while running a pipeline entry like today.

- generally enabling the read-side protection for the oob context, while leaving the QSBR work to the in-band context.

However, we must be sure not to leak oob read-side sections into the inband context, i.e. being cautious about oob -> inband transitions, and perhaps more tricky issues.

Signature · 1 line
Philippe.