From: Zijun Hu <zijun_hu@icloud.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Dave Ertman <david.m.ertman@intel.com>,
Ira Weiny <ira.weiny@intel.com>,
Leon Romanovsky <leon@kernel.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
linux-kernel@vger.kernel.org,
Zijun Hu <zijun.hu@oss.qualcomm.com>
Subject: Re: [PATCH] driver core: auxiliary bus: Optimize auxiliary_match_id()
Date: Tue, 2 Sep 2025 21:06:28 +0800 [thread overview]
Message-ID: <e9059345-a41e-451e-adac-53fa7519fc5b@icloud.com> (raw)
In-Reply-To: <2025090209-unlinked-remedial-555e@gregkh>
On 2025/9/2 20:51, Greg Kroah-Hartman wrote:
>> auxiliary_match_id() repeatedly calculates variable @match_size in the
>> for loop. however, the variable is fixed actually. so it is enough to
>> calculate the variable once.
>>
>> Optimize it by moving the logic calculating the variable out of the for
>> loop, and it result in:
>>
>> 1) calculate the variable once instead of repeatedly.
>> 2) it will return as early as possible if device name is unexpected,
>> namely, (@p == NULL).
>>
>> so this fix will improve performance.
> This isn't a "performant" path at all, is it?
>
agree.
the patch is to improve the function's logic a bit.
> I'm not disagreeing that calculating this all the time is a bad idea,
> but please be reasonable. If it can't be measured, you can't really say
> it will "improve performance" 🙂
prev parent reply other threads:[~2025-09-02 13:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 12:05 Zijun Hu
2025-09-02 12:20 ` Greg Kroah-Hartman
2025-09-02 12:42 ` Zijun Hu
2025-09-02 12:49 ` Leon Romanovsky
2025-09-02 12:51 ` Greg Kroah-Hartman
2025-09-02 13:06 ` Zijun Hu [this message]
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=e9059345-a41e-451e-adac-53fa7519fc5b@icloud.com \
--to=zijun_hu@icloud.com \
--cc=dakr@kernel.org \
--cc=david.m.ertman@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=zijun.hu@oss.qualcomm.com \
/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
all inboxes | Powered by JetHome®