Re: [PATCH v2] s390/rwlock: Add contention tracepoints to rwlock slowpath

From: Heiko Carstens

Date: Mon Sep 14 2026 - 13:59:57 EST


On Tue, Sep 08, 2026 at 03:58:43PM +0200, Jan Polensky wrote:
> Instrument arch_read_lock_wait() and arch_write_lock_wait() with
> trace_contention_begin() and trace_contention_end().
>
> These tracepoints are used by lock contention analysis tools such as
> perf lock contention to identify contended rwlocks and measure wait
> times. The generic implementation in kernel/locking/qrwlock.c already
> emits the same events from its read and write slowpaths.
>
> For arch_read_lock_wait(), the in_interrupt() fast-path is intentionally
> left outside the tracepoint scope. That path spins without entering the
> wait queue, so it does not represent queue-based contention and its
> duration is not comparable to the normal slowpath. This matches the
> behaviour of queued_read_lock_slowpath() in qrwlock.c.
>
> The include for <trace/events/lock.h> is already present from
> commit ffa796cc1f45 ("s390/spinlock: Add contention tracepoints to
> lock slowpath").
>
> Signed-off-by: Jan Polensky <japo@xxxxxxxxxxxxx>
> ---
> v1 -> v2:
> - Fix tracepoint placement in arch_read_lock_wait() to avoid recursion deadlocks.
>
> arch/s390/lib/spinlock.c | 4 ++++
> 1 file changed, 4 insertions(+)

Applied, thanks!