Skip to content

Commit c7a1810

Browse files
committed
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: 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
1 parent f86fd32 commit c7a1810

3 files changed

Lines changed: 3 additions & 17 deletions

File tree

‎arch/arm/include/asm/vdso/vsyscall.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ struct vdso_data *__arm_get_k_vdso_data(void)
2121
}
2222
#define __arch_get_k_vdso_data __arm_get_k_vdso_data
2323

24-
static __always_inline
25-
bool __arm_update_vdso_data(void)
26-
{
27-
return cntvct_ok;
28-
}
29-
#define __arch_update_vdso_data __arm_update_vdso_data
30-
3124
static __always_inline
3225
void __arm_sync_vdso_data(struct vdso_data *vdata)
3326
{

‎include/asm-generic/vdso/vsyscall.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ static __always_inline struct vdso_data *__arch_get_k_vdso_data(void)
1111
}
1212
#endif /* __arch_get_k_vdso_data */
1313

14-
#ifndef __arch_update_vdso_data
15-
static __always_inline bool __arch_update_vdso_data(void)
16-
{
17-
return true;
18-
}
19-
#endif /* __arch_update_vdso_data */
20-
2114
#ifndef __arch_update_vsyscall
2215
static __always_inline void __arch_update_vsyscall(struct vdso_data *vdata,
2316
struct timekeeper *tk)

‎kernel/time/vsyscall.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ void update_vsyscall(struct timekeeper *tk)
105105
WRITE_ONCE(vdata[CS_HRES_COARSE].hrtimer_res, hrtimer_resolution);
106106

107107
/*
108-
* Architectures can opt out of updating the high resolution part
109-
* of the VDSO.
108+
* If the current clocksource is not VDSO capable, then spare the
109+
* update of the high reolution parts.
110110
*/
111-
if (__arch_update_vdso_data())
111+
if (clock_mode != VDSO_CLOCKMODE_NONE)
112112
update_vdso_data(vdata, tk);
113113

114114
__arch_update_vsyscall(vdata, tk);

0 commit comments

Comments
 (0)