]> git.baikalelectronics.ru Git - kernel.git/commitdiff
lib/vdso: Avoid highres update if clocksource is not VDSO capable
authorThomas Gleixner <tglx@linutronix.de>
Fri, 7 Feb 2020 12:39:00 +0000 (13:39 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 17 Feb 2020 19:12:17 +0000 (20:12 +0100)
If the current clocksource is not VDSO capable there is no point in
updating the high resolution parts of the VDSO data.

Replace the architecture specific check with a check for a VDSO capable
clocksource and skip the update if there is none.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lkml.kernel.org/r/20200207124403.563379423@linutronix.de
arch/arm/include/asm/vdso/vsyscall.h
include/asm-generic/vdso/vsyscall.h
kernel/time/vsyscall.c

index 002f9edd8a2b37d936076c875fdbc438a921cc4b..47e41ae8ccd0b997b54dda59abea8ae98bbe3c56 100644 (file)
@@ -21,13 +21,6 @@ struct vdso_data *__arm_get_k_vdso_data(void)
 }
 #define __arch_get_k_vdso_data __arm_get_k_vdso_data
 
-static __always_inline
-bool __arm_update_vdso_data(void)
-{
-       return cntvct_ok;
-}
-#define __arch_update_vdso_data __arm_update_vdso_data
-
 static __always_inline
 void __arm_sync_vdso_data(struct vdso_data *vdata)
 {
index 4a28797495d7965753952566d0e3fc56f036a60d..c835607f78ae990e7479878767b05cccd3a99837 100644 (file)
@@ -11,13 +11,6 @@ static __always_inline struct vdso_data *__arch_get_k_vdso_data(void)
 }
 #endif /* __arch_get_k_vdso_data */
 
-#ifndef __arch_update_vdso_data
-static __always_inline bool __arch_update_vdso_data(void)
-{
-       return true;
-}
-#endif /* __arch_update_vdso_data */
-
 #ifndef __arch_update_vsyscall
 static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata,
                                                   struct timekeeper *tk)
index d31a5ef4ade51bfcf3bf446e95f351b3d255c2aa..54ce6eb2ca36db6f34a07ac8dac3ae6f0814a01b 100644 (file)
@@ -105,10 +105,10 @@ void update_vsyscall(struct timekeeper *tk)
        WRITE_ONCE(vdata[CS_HRES_COARSE].hrtimer_res, hrtimer_resolution);
 
        /*
-        * Architectures can opt out of updating the high resolution part
-        * of the VDSO.
+        * If the current clocksource is not VDSO capable, then spare the
+        * update of the high reolution parts.
         */
-       if (__arch_update_vdso_data())
+       if (clock_mode != VDSO_CLOCKMODE_NONE)
                update_vdso_data(vdata, tk);
 
        __arch_update_vsyscall(vdata, tk);