Re: [PATCH v2 4/4] rv/rtapp: Add wakeup monitor

Chao Liu <[email protected]>
Newsgroups org.kernel.vger.linux-trace-kernel,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Nam,

I've been looking into the RV subsystem, and while reading this patch
I noticed a small inconsistency.

On Fri, Jun 19, 2026 at 09:21:22AM +0800, Nam Cao wrote:
> Add a wakeup monitor to detect a lower-priority task waking up a
> higher-priority task.
> 
> The rtapp/sleep monitor already detects this. However, that monitor
> triggers an error in the context of the wakee task and user only gets
> the stacktrace of that task. It is also extremely useful to get the
> stacktrace of the waker task, which this monitor offers. In other
> words, this monitor complements the rtapp/sleep monitor.
> 
> Signed-off-by: Nam Cao <[email protected]>
> ---

[...]

> +Monitor wakeup
> +++++++++++++++
> +
> +The `wakeup` monitor reports real-time threads being woken by lower-priority threads,
> +which is a hint of priority inversion. Its specification is::
> +
> +  RULE = always (((RT and USER_THREAD) imply
> +                (not (WOKEN_BY_LOWER_PRIO or WOKEN_BY_SOFTIRQ)) or ALLOWLIST))
> +
> +  ALLOWLIST = BLOCK_ON_RT_MUTEX
> +           or FUTEX_LOCK_PI
> +

[...]

> +static void handle_sched_waking(void *data, struct task_struct *task)
> +{
> +	if (in_task()) {
> +		if (current->prio > task->prio)
> +			ltl_atom_pulse(task, LTL_WOKEN_BY_LOWER_PRIO, true);

The implementation also reports wakeups from softirq context through
WOKEN_BY_SOFTIRQ:

> +	} else if (in_serving_softirq()) {
> +		ltl_atom_pulse(task, LTL_WOKEN_BY_SOFTIRQ, true);
> +	}

Should this description mention softirq wakeups as well?

The Kconfig help text, struct rv_monitor's .description, and
MODULE_DESCRIPTION() seem to have the same omission.

I also have a small follow-up documentation patch based on this series,
which I plan to send as an RFC shortly.

Thanks,
Chao
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.