]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Switch to CLOCK_MONOTONIC_COARSE
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 18 Jun 2023 18:31:59 +0000 (14:31 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 18 Jun 2023 18:32:28 +0000 (14:32 -0400)
CLOCK_MONOTONIC requires a syscall, and is much more expensive.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
include/linux/jiffies.h

index 4fd3b68d4cfe63cca48e8b27c01310c47735157b..d16ea76f7b65e0e621790ed951a9c9c557caf735 100644 (file)
@@ -71,7 +71,7 @@ static inline u64 sched_clock(void)
 {
        struct timespec ts;
 
-       clock_gettime(CLOCK_MONOTONIC, &ts);
+       clock_gettime(CLOCK_MONOTONIC_COARSE, &ts);
 
        return ((s64) ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec;
 }