Re: [PATCH v7 3/3] locking: Add contended_release tracepoint to sleepable locks

From: Usama Arif

Date: Thu Jun 04 2026 - 10:54:06 EST


On Thu, 4 Jun 2026 07:15:07 +0000 Dmitry Ilvokhin <d@xxxxxxxxxxxx> wrote:

> Add the contended_release trace event. This tracepoint fires on the
> holder side when a contended lock is released, complementing the
> existing contention_begin/contention_end tracepoints which fire on the
> waiter side.
>
> This enables correlating lock hold time under contention with waiter
> events by lock address.
>
> Add trace_contended_release()/trace_call__contended_release() calls to
> the slowpath unlock paths of sleepable locks: mutex, rtmutex, semaphore,
> rwsem, percpu-rwsem, and RT-specific rwbase locks.
>
> Where possible, trace_contended_release() fires before the lock is
> released and before the waiter is woken. For some lock types, the
> tracepoint fires after the release but before the wake. Making the
> placement consistent across all lock types is not worth the added
> complexity.
>
> For reader/writer locks, the tracepoint fires for every reader releasing
> while a writer is waiting, not only for the last reader.
>
> Signed-off-by: Dmitry Ilvokhin <d@xxxxxxxxxxxx>
> Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxx>

Acked-by: Usama Arif <usama.arif@xxxxxxxxx>