mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: Karl Mehltretter <kmehltretter@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers	 <mathieu.desnoyers@efficios.com>,
	Thomas Gleixner <tglx@kernel.org>,
	 Sebastian Andrzej Siewior	 <bigeasy@linutronix.de>,
	Clark Williams <clrkwllms@kernel.org>,
	Ingo Molnar	 <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski	 <luto@kernel.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot	 <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	 Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	 K Prateek Nayak <kprateek.nayak@amd.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	 Randy Dunlap <rdunlap@infradead.org>,
	linux-trace-kernel@vger.kernel.org,
	linux-rt-devel@lists.linux.dev, 	linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/9] rv: Verify generic IRQ context transitions
Date: Fri, 23 Oct 2026 18:05:30 +0200	[thread overview]
Message-ID: <5b3ff014bf2f571b935f9519f422966a1c665c32.camel@redhat.com> (raw)
In-Reply-To: <20261022050712.75035-1-kmehltretter@gmail.com>

On Thu, 2026-10-22 at 07:07 +0200, Karl Mehltretter wrote:
> IRQ action tracepoints describe handlers, but not the lifetime of the
> enclosing IRQ context. One context may run several actions, and an action
> may be dispatched outside hardirq context. PREEMPT_RT may also enter
> serving-softirq state without invoking an action. This leaves no generic
> event stream from which an RV monitor can check IRQ-context transitions.
> 
> This RFC adds events at the generic hardirq and serving-softirq
> boundaries. The irqstate RV monitor checks their order and agreement with
> live kernel state. irqexit follows the owner of a preempt_schedule_irq()
> invocation across task switches and CPU migration.
> 
> The hardirq events cover paths through irq_enter() or irq_enter_rcu() and
> their matching exits. They do not cover direct __irq_enter() and
> __irq_exit() users, raw paths, or architecture-specific entry and return
> intervals. irqexit covers preempt_schedule_irq(), not the complete
> interrupt-return path.
> 
> Boundary callbacks can raise softirq work after the pending-work check.
> The series wakes ksoftirqd or ktimerd for remaining work. KUnit covers
> nesting, monitor synchronization, PREEMPT_RT worker intervals, provenance
> and late-work handoff.

Hi Karl,

thanks for your contribution!
I'm probably not going to have much time to look at this soon as I have a few
holidays planned and other series to review first. But it looks interesting.

What points my eyes is that you didn't include any schematic graph in the
documentation.
Some folks don't like RST, but I find having a textual representation of the
model there easy to understand what you're trying to do without having to build
the models.
We use graph-easy for that (and adapt things if the model is too complex).

Do not send a V2 just for this, but please keep that in mind for next time.

Thanks,
Gabriele

> 
> Cross-architecture RV KUnit testing also exposed an Arm-specific opid bug:
> 
>   https://lore.kernel.org/r/20261020035158.90190-1-kmehltretter@gmail.com
> 
> I would especially appreciate feedback on:
> 
>   1. Should the context boundaries be trace events or private RV
>      instrumentation?
>   2. Are dedicated scheduler events the right way to follow
>      preempt_schedule_irq() across task switches and migration?
>   3. Should irqstate and irqexit remain separate monitors?
>   4. Is the KUnit-only hook for an empty ksoftirqd invocation acceptable?
>      Outside a KUnit run, its worker checks take a disabled static-key
>      path.
> 
> Patches 1-5 add the events, monitors, and documentation. Patches 6-9 add
> KUnit coverage.
> 
> This series is based on v7.3 (c03c1a14507d) and depends on the following
> accepted change, which is not included:
> 
>   softirq: Preserve interrupt context on return from interrupt
>   https://lore.kernel.org/r/20261011060742.30584-1-kmehltretter@gmail.com
> 
> A pre-existing issue can make rv_test_dummy intermittently report a
> false-positive invalid-wait-context warning under lockdep. Wen Yang has
> posted a fix:
> 
>  
> https://lore.kernel.org/lkml/5586dd00789a0f904cc299cd8889744b8c6f8dc9.1789412799.git.wen.yang@linux.dev/
> 
> This series does not include that fix.
> 
> Karl Mehltretter (9):
>   tracing/irq: Add generic IRQ context boundary events
>   tracing/sched: Add IRQ preemption lifecycle events
>   rv: Add a monitor for generic IRQ context transitions
>   rv: Add a monitor for IRQ-exit scheduling ownership
>   docs/rv: Document the IRQ-entry monitors
>   rv: Add KUnit coverage for IRQ context transitions
>   rv: Add KUnit coverage for IRQ-exit scheduling
>   rv: Test empty PREEMPT_RT softirq worker intervals
>   rv: Test IRQ-exit softirq provenance and handoff
> 
>  Documentation/trace/rv/index.rst              |    1 +
>  Documentation/trace/rv/monitor_irqentry.rst   |  398 ++++
>  include/linux/interrupt.h                     |    7 +
>  include/rv/kunit.h                            |   34 +-
>  include/trace/events/irq.h                    |   70 +
>  include/trace/events/sched.h                  |   51 +
>  kernel/sched/core.c                           |    6 +
>  kernel/softirq.c                              |  308 ++-
>  kernel/trace/rv/Kconfig                       |    5 +
>  kernel/trace/rv/Makefile                      |    3 +
>  kernel/trace/rv/monitors/irqentry/Kconfig     |   13 +
>  kernel/trace/rv/monitors/irqentry/irqentry.c  |   35 +
>  kernel/trace/rv/monitors/irqentry/irqentry.h  |    3 +
>  kernel/trace/rv/monitors/irqexit/Kconfig      |   14 +
>  kernel/trace/rv/monitors/irqexit/irqexit.c    |  172 ++
>  kernel/trace/rv/monitors/irqexit/irqexit.h    |   85 +
>  .../trace/rv/monitors/irqexit/irqexit_kunit.c |  537 +++++
>  .../trace/rv/monitors/irqexit/irqexit_kunit.h |   21 +
>  .../trace/rv/monitors/irqexit/irqexit_trace.h |   19 +
>  kernel/trace/rv/monitors/irqstate/Kconfig     |   14 +
>  kernel/trace/rv/monitors/irqstate/irqstate.c  |  289 +++
>  kernel/trace/rv/monitors/irqstate/irqstate.h  |  139 ++
>  .../rv/monitors/irqstate/irqstate_kunit.c     | 2062 +++++++++++++++++
>  .../rv/monitors/irqstate/irqstate_kunit.h     |   25 +
>  .../rv/monitors/irqstate/irqstate_trace.h     |   15 +
>  kernel/trace/rv/rv_monitors_test.c            |   29 +
>  kernel/trace/rv/rv_trace.h                    |    2 +
>  .../verification/models/irqentry/irqexit.dot  |   21 +
>  .../verification/models/irqentry/irqstate.dot |   32 +
>  29 files changed, 4397 insertions(+), 13 deletions(-)
>  create mode 100644 Documentation/trace/rv/monitor_irqentry.rst
>  create mode 100644 kernel/trace/rv/monitors/irqentry/Kconfig
>  create mode 100644 kernel/trace/rv/monitors/irqentry/irqentry.c
>  create mode 100644 kernel/trace/rv/monitors/irqentry/irqentry.h
>  create mode 100644 kernel/trace/rv/monitors/irqexit/Kconfig
>  create mode 100644 kernel/trace/rv/monitors/irqexit/irqexit.c
>  create mode 100644 kernel/trace/rv/monitors/irqexit/irqexit.h
>  create mode 100644 kernel/trace/rv/monitors/irqexit/irqexit_kunit.c
>  create mode 100644 kernel/trace/rv/monitors/irqexit/irqexit_kunit.h
>  create mode 100644 kernel/trace/rv/monitors/irqexit/irqexit_trace.h
>  create mode 100644 kernel/trace/rv/monitors/irqstate/Kconfig
>  create mode 100644 kernel/trace/rv/monitors/irqstate/irqstate.c
>  create mode 100644 kernel/trace/rv/monitors/irqstate/irqstate.h
>  create mode 100644 kernel/trace/rv/monitors/irqstate/irqstate_kunit.c
>  create mode 100644 kernel/trace/rv/monitors/irqstate/irqstate_kunit.h
>  create mode 100644 kernel/trace/rv/monitors/irqstate/irqstate_trace.h
>  create mode 100644 tools/verification/models/irqentry/irqexit.dot
>  create mode 100644 tools/verification/models/irqentry/irqstate.dot
> 
> base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
> prerequisite-patch-id: 6ac7167f0aa7c5319dac78bf5b06a989fd7dfac5


      parent reply	other threads:[~2026-10-23 16:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22  5:07 Karl Mehltretter
2026-10-22  5:07 ` [RFC PATCH 1/9] tracing/irq: Add generic IRQ context boundary events Karl Mehltretter
2026-10-22  5:44   ` sashiko-bot
2026-10-22  5:07 ` [RFC PATCH 2/9] tracing/sched: Add IRQ preemption lifecycle events Karl Mehltretter
2026-10-22  5:07 ` [RFC PATCH 3/9] rv: Add a monitor for generic IRQ context transitions Karl Mehltretter
2026-10-22  5:07 ` [RFC PATCH 4/9] rv: Add a monitor for IRQ-exit scheduling ownership Karl Mehltretter
2026-10-22  5:07 ` [RFC PATCH 5/9] docs/rv: Document the IRQ-entry monitors Karl Mehltretter
2026-10-22  5:07 ` [RFC PATCH 6/9] rv: Add KUnit coverage for IRQ context transitions Karl Mehltretter
2026-10-22  5:33   ` sashiko-bot
2026-10-22  5:07 ` [RFC PATCH 7/9] rv: Add KUnit coverage for IRQ-exit scheduling Karl Mehltretter
2026-10-22  5:30   ` sashiko-bot
2026-10-22  5:07 ` [RFC PATCH 8/9] rv: Test empty PREEMPT_RT softirq worker intervals Karl Mehltretter
2026-10-22  5:07 ` [RFC PATCH 9/9] rv: Test IRQ-exit softirq provenance and handoff Karl Mehltretter
2026-10-22  5:33   ` sashiko-bot
2026-10-23 16:05 ` Gabriele Monaco [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=5b3ff014bf2f571b935f9519f422966a1c665c32.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=bsegall@google.com \
    --cc=clrkwllms@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kmehltretter@gmail.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mgorman@suse.de \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tglx@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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

all inboxes | Powered by JetHome®