[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87h65zbx2e.ffs@tglx>
Date: Wed, 15 Jan 2025 22:12:57 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Zhongqiu Han <quic_zhonhan@...cinc.com>, anna-maria@...utronix.de,
frederic@...nel.org
Cc: linux-kernel@...r.kernel.org, quic_zhonhan@...cinc.com
Subject: Re: [PATCH] timers: Optimize get_timer_cpu_base() to reduce
potentially redundant per_cpu_ptr() calls
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().
> 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.
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
Powered by blists - more mailing lists