[patch 17/38] ext4: Replace get_cycles() usage with ktime_get()
Arnd Bergmann
arnd at arndb.de
Tue Apr 14 00:46:30 AEST 2026
On Fri, Apr 10, 2026, at 14:19, Thomas Gleixner wrote:
> get_cycles() is not guaranteed to be functional on all systems/platforms
> and the values returned are unitless and not easy to map to something
> useful.
>
> Use ktime_get() instead, which provides nanosecond timestamps and is
> functional everywhere.
>
> This is part of a larger effort to limit get_cycles() usage to low level
> architecture code.
>
> Signed-off-by: Thomas Gleixner <tglx at kernel.org>
> Cc: "Theodore Ts'o" <tytso at mit.edu>
> Cc: linux-ext4 at vger.kernel.org
I think this is technically an ABI chance, since the time
difference gets exported through procfs, but the new version
is clearly the right thing to do since it replaces a hardware
specific value with a portable one.
Arnd
More information about the Linuxppc-dev
mailing list