[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <62582edd-d4ff-4e7b-b296-cd6dcf520160@quicinc.com>
Date: Thu, 16 Jan 2025 11:36:41 +0800
From: Zhongqiu Han <quic_zhonhan@...cinc.com>
To: Thomas Gleixner <tglx@...utronix.de>, <anna-maria@...utronix.de>,
<frederic@...nel.org>
CC: <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] timers: Optimize get_timer_cpu_base() to reduce
potentially redundant per_cpu_ptr() calls
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
Powered by blists - more mailing lists