Re: [PATCH v3] lockdep: Move the emergency section out of print_irqtrace_events()

From: John Ogness

Date: Mon Nov 09 2026 - 09:14:20 EST


On 2026-11-09, Breno Leitao <leitao@xxxxxxxxxx> wrote:
> Commit 59cd94ef8009 ("lockdep: Mark emergency sections in lockdep
> splats") made print_irqtrace_events() enter an nbcon emergency section
> by itself. That was meant for lockdep splats, but the function is also
> used outside lockdep (by verbose KCSAN reports, the soft and hard
> lockup detectors, etc).
>
> For KCSAN, as print_report() runs with the raw report_lock held and
> interrupts disabled, so every verbose report writes out the whole
> console backlog under report_lock. Other CPUs that detect a race in the
> meantime spin on report_lock with interrupts disabled, as the lock is
> taken before rate_limit_report() gets a chance to drop the report.
>
> That causes this type of problems (as seen in Meta's fleet):
>
> BUG: KCSAN: data-race in mlx5e_poll_tx_cq+0x5d8/0x998
> ...
> irq event stamp: 28975074
> smp: csd: Detected non-responsive CSD lock (#2) on CPU#35, waiting 5000000052 ns for CPU#26 ipi_mb+0x0/0x18(0x0).
> smp: csd: Detected non-responsive CSD lock (#3) on CPU#65, waiting 5000000020 ns for CPU#00 do_nothing+0x0/0x18(0x0).
> watchdog: CPU71: Watchdog detected hard LOCKUP on cpu 0
> Kernel panic - not syncing: Hard LOCKUP
>
> Drop the emergency section from print_irqtrace_events() and enter it
> around the call in check_flags(), the only lockdep splat that prints
> the irqtrace events outside of one. The other splats and __warn()
> already wrap their whole output in an emergency section.
>
> Fixes: 59cd94ef8009 ("lockdep: Mark emergency sections in lockdep splats")
> Suggested-by: John Ogness <john.ogness@xxxxxxxxxxxxx>
> Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>

Reviewed-by: John Ogness <john.ogness@xxxxxxxxxxxxx>