Re: [PATCH v3] locking/rwsem: Add __always_inline annotation to __down_read_common() and inlined callers

From: Peter Zijlstra
Date: Mon May 08 2023 - 04:24:54 EST


On Wed, May 03, 2023 at 02:33:51AM +0000, John Stultz wrote:
> Apparently despite it being marked inline, the compiler
> may not inline __down_read_common() which makes it difficult
> to identify the cause of lock contention, as the blocked
> function in traceevents will always be listed as
> __down_read_common().
>
> So this patch adds __always_inline annotation to the common
> function (as well as the inlined helper callers) to force it to
> be inlined so the blocking function will be listed (via Wchan)
> in traceevents.
>
> Cc: Minchan Kim <minchan@xxxxxxxxxx>
> Cc: Tim Murray <timmurray@xxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Cc: Waiman Long <longman@xxxxxxxxxx>
> Cc: Boqun Feng <boqun.feng@xxxxxxxxx>
> Cc: kernel-team@xxxxxxxxxxx
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: c995e638ccbb ("locking/rwsem: Fold __down_{read,write}*()")
> Reviewed-by: Waiman Long <longman@xxxxxxxxxx>
> Reported-by: Tim Murray <timmurray@xxxxxxxxxx>
> Signed-off-by: John Stultz <jstultz@xxxxxxxxxx>

Thanks!