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 <[email protected]> Cc: "Theodore Ts'o" <[email protected]> Cc: [email protected] --- fs/ext4/mballoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1289,7 +1289,7 @@ void ext4_mb_generate_buddy(struct super ext4_grpblk_t len; unsigned free = 0; unsigned fragments = 0; - unsigned long long period = get_cycles(); + ktime_t period = ktime_get(); /* initialize buddy from bitmap which is aggregation * of on-disk bitmap and preallocations */ @@ -1328,7 +1328,7 @@ void ext4_mb_generate_buddy(struct super clear_bit(EXT4_GROUP_INFO_NEED_INIT_BIT, &(grp->bb_state)); - period = get_cycles() - period; + period = ktime_get() - period; atomic_inc(&sbi->s_mb_buddies_generated); atomic64_add(period, &sbi->s_mb_generation_time); }

