linux: Remove supports_time64 () from clock_gettime
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 16 Jun 2021 01:10:26 +0000 (22:10 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 22 Jun 2021 15:09:52 +0000 (12:09 -0300)
It breaks the usage case of live migration like CRIU or similar.
The performance drawback is it would require an extra syscall
on older kernels without 64-bit time support.

Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel
(with and without --enable-kernel=5.1) and on x86_64-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
sysdeps/unix/sysv/linux/clock_gettime.c

index 781d05c..cfe9370 100644 (file)
@@ -22,7 +22,6 @@
 #include <time.h>
 #include "kernel-posix-cpu-timers.h"
 #include <sysdep-vdso.h>
-#include <time64-support.h>
 #include <shlib-compat.h>
 
 /* Get current value of CLOCK and store it in TP.  */
@@ -35,19 +34,14 @@ __clock_gettime64 (clockid_t clock_id, struct __timespec64 *tp)
 # define __NR_clock_gettime64 __NR_clock_gettime
 #endif
 
-  if (supports_time64 ())
-    {
 #ifdef HAVE_CLOCK_GETTIME64_VSYSCALL
-      r = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
+  r = INLINE_VSYSCALL (clock_gettime64, 2, clock_id, tp);
 #else
-      r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp);
+  r = INLINE_SYSCALL_CALL (clock_gettime64, clock_id, tp);
 #endif
 
-      if (r == 0 || errno != ENOSYS)
-       return r;
-
-      mark_time64_unsupported ();
-   }
+  if (r == 0 || errno != ENOSYS)
+    return r;
 
 #ifndef __ASSUME_TIME64_SYSCALLS
   /* Fallback code that uses 32-bit support.  */