From: Zhongqiu Han <quic_zhonhan@quicinc.com>
To: Thomas Gleixner <tglx@linutronix.de>, <anna-maria@linutronix.de>,
<frederic@kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] timers: Optimize get_timer_cpu_base() to reduce potentially redundant per_cpu_ptr() calls
Date: Thu, 16 Jan 2025 11:36:41 +0800 [thread overview]
Message-ID: <62582edd-d4ff-4e7b-b296-cd6dcf520160@quicinc.com> (raw)
In-Reply-To: <87h65zbx2e.ffs@tglx>
On 1/16/2025 5:12 AM, Thomas Gleixner wrote:
> On Tue, Dec 31 2024 at 23:01, Zhongqiu Han wrote:
>> If the timer is deferrable and NO_HZ_COMMON is enabled, the function
>> get_timer_cpu_base() will call per_cpu_ptr() twice. Optimize the function
>> to avoid potentially redundant per_cpu_ptr() calls.
>
> This lacks an explanation for the second hunk which changes
> get_timer_this_cpu_base().
>
Acknowledged.
>> One of the call paths of the get_timer_cpu_base() function is through the
>> lock_timer_base() function, which contains a loop. Within this loop, the
>> get_timer_base() func is called, and in turn, it calls the
>> get_timer_cpu_base() function. And in such a path, get_timer_cpu_base is
>> a hotspot function. It is called approximately 13,000 times in 12 seconds
>> on test x86 KVM machines.
>
> Which is roughly once per millisecond and depending on the number of
> CPUs that's far from a hotspot.
Acknowledged.
>
> I'm not against the change per se, but this change log is a bit over the
> top aside of ot mentioning the second hunk. I'll fix it up when
> applying.
>
> Thanks,
>
> tglx
Hi tglx / Frederic,
Thanks for the review.
Since you will help modify the commit message when applying, I will not
arise patchset2. Thanks~
--
Thx and BRs,
Zhongqiu Han
next prev parent reply other threads:[~2025-01-16 3:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-31 15:01 Zhongqiu Han
2024-12-31 16:08 ` Frederic Weisbecker
2025-01-15 21:12 ` Thomas Gleixner
2025-01-16 3:36 ` Zhongqiu Han [this message]
2025-01-16 8:08 ` [tip: timers/core] timers: Optimize get_timer_[this_]cpu_base() tip-bot2 for Zhongqiu Han
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=62582edd-d4ff-4e7b-b296-cd6dcf520160@quicinc.com \
--to=quic_zhonhan@quicinc.com \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome