[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <88977fec-16f9-a507-c717-709d6288084a@redhat.com>
Date: Mon, 17 Apr 2023 10:09:04 -0400
From: Waiman Long <longman@...hat.com>
To: Peter Zijlstra <peterz@...radead.org>,
John Stultz <jstultz@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Minchan Kim <minchan@...nel.org>,
Tim Murray <timmurray@...gle.com>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, kernel-team@...roid.com,
stable@...r.kernel.org
Subject: Re: [PATCH v2] locking/rwsem: Add __always_inline annotation to
__down_read_common()
On 4/17/23 07:19, Peter Zijlstra wrote:
> On Wed, Apr 12, 2023 at 03:59:05AM +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 will always be listed as __down_read_common().
>>
>> So this patch adds __always_inline annotation to the
>> function to force it to be inlines so the calling function
>> will be listed.
> I'm a wee bit confused; what are you looking at? Wchan? What is stopping
> the compiler from now handing you
> __down_read{,_interruptible,_killable}() instead? Is that fine?
>
My theory is that the compiler may refuse to inline __down_read_common()
because it is called 3 times in order to reduce overall code size. The
other __down_read*() functions you listed are only called once.
My 2 cents.
Cheers,
Longman
Powered by blists - more mailing lists