Commit c7a18100 authored by Thomas Gleixner's avatar Thomas Gleixner

lib/vdso: Avoid highres update if clocksource is not VDSO capable

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: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lkml.kernel.org/r/20200207124403.563379423@linutronix.de
parent f86fd32d
...@@ -21,13 +21,6 @@ struct vdso_data *__arm_get_k_vdso_data(void) ...@@ -21,13 +21,6 @@ struct vdso_data *__arm_get_k_vdso_data(void)
} }
#define __arch_get_k_vdso_data __arm_get_k_vdso_data #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 static __always_inline
void __arm_sync_vdso_data(struct vdso_data *vdata) void __arm_sync_vdso_data(struct vdso_data *vdata)
{ {
......
...@@ -11,13 +11,6 @@ static __always_inline struct vdso_data *__arch_get_k_vdso_data(void) ...@@ -11,13 +11,6 @@ static __always_inline struct vdso_data *__arch_get_k_vdso_data(void)
} }
#endif /* __arch_get_k_vdso_data */ #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 #ifndef __arch_update_vsyscall
static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata, static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata,
struct timekeeper *tk) struct timekeeper *tk)
......
...@@ -105,10 +105,10 @@ void update_vsyscall(struct timekeeper *tk) ...@@ -105,10 +105,10 @@ void update_vsyscall(struct timekeeper *tk)
WRITE_ONCE(vdata[CS_HRES_COARSE].hrtimer_res, hrtimer_resolution); WRITE_ONCE(vdata[CS_HRES_COARSE].hrtimer_res, hrtimer_resolution);
/* /*
* Architectures can opt out of updating the high resolution part * If the current clocksource is not VDSO capable, then spare the
* of the VDSO. * update of the high reolution parts.
*/ */
if (__arch_update_vdso_data()) if (clock_mode != VDSO_CLOCKMODE_NONE)
update_vdso_data(vdata, tk); update_vdso_data(vdata, tk);
__arch_update_vsyscall(vdata, tk); __arch_update_vsyscall(vdata, tk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment