From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>, John Stultz <jstultz@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Minchan Kim <minchan@kernel.org>,
Tim Murray <timmurray@google.com>, Ingo Molnar <mingo@redhat.com>,
Will Deacon <will@kernel.org>, Boqun Feng <boqun.feng@gmail.com>,
kernel-team@android.com, stable@vger.kernel.org
Subject: Re: [PATCH v2] locking/rwsem: Add __always_inline annotation to __down_read_common()
Date: Mon, 17 Apr 2023 10:09:04 -0400 [thread overview]
Message-ID: <88977fec-16f9-a507-c717-709d6288084a@redhat.com> (raw)
In-Reply-To: <20230417111949.GJ83892@hirez.programming.kicks-ass.net>
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
next prev parent reply other threads:[~2023-04-17 14:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 2:38 [RFC][PATCH] locking/rwsem: Add __sched annotation to __down_read_common() John Stultz
2023-04-12 2:58 ` Waiman Long
2023-04-12 3:03 ` John Stultz
2023-04-12 3:59 ` [PATCH v2] locking/rwsem: Add __always_inline " John Stultz
2023-04-12 12:10 ` Waiman Long
2023-04-17 11:19 ` Peter Zijlstra
2023-04-17 14:09 ` Waiman Long [this message]
2023-04-17 16:22 ` John Stultz
2023-04-18 10:30 ` Peter Zijlstra
2023-04-18 11:59 ` John Stultz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=88977fec-16f9-a507-c717-709d6288084a@redhat.com \
--to=longman@redhat.com \
--cc=boqun.feng@gmail.com \
--cc=jstultz@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=timmurray@google.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox