Re: [tip: timers/vdso] vdso/gettimeofday: Add a helper to test if a clock is namespaced
From: Thomas Weißschuh
Date: Wed Mar 11 2026 - 06:47:51 EST
On Wed, Mar 11, 2026 at 09:31:30AM +0000, tip-bot2 for Thomas Weißschuh wrote:
> The following commit has been merged into the timers/vdso branch of tip:
>
> Commit-ID: daa2b92d33a4038123598aff55240ae3c54f870c
> Gitweb: https://git.kernel.org/tip/daa2b92d33a4038123598aff55240ae3c54f870c
> Author: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
> AuthorDate: Fri, 27 Feb 2026 07:43:22 +01:00
> Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
> CommitterDate: Wed, 11 Mar 2026 10:27:35 +01:00
>
> vdso/gettimeofday: Add a helper to test if a clock is namespaced
>
> Currently this logic is duplicate multiple times.
>
> Add a helper for it to make the code more readable.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
> Link: https://patch.msgid.link/20260227-vdso-cleanups-v1-3-c848b4bc4850@xxxxxxxxxxxxx
> ---
> include/vdso/helpers.h | 7 ++++++-
> lib/vdso/gettimeofday.c | 9 +++------
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/include/vdso/helpers.h b/include/vdso/helpers.h
> index 9ccf6b5..a776554 100644
> --- a/include/vdso/helpers.h
> +++ b/include/vdso/helpers.h
> @@ -7,6 +7,11 @@
> #include <asm/barrier.h>
> #include <vdso/datapage.h>
>
> +static __always_inline bool vdso_is_timens_clock(const struct vdso_clock *vc)
> +{
> + return IS_ENABLED(CONFIG_TIME_NS) && vc->clock_mode == VDSO_CLOCKMODE_TIMENS;
> +}
Welp, I never seem to have tested this together with my own vDSO header cleanup
series. This fails to build because VDSO_CLOCKMODE_TIMENS is not visible.
There should be an include of <vdso/clocksource.h> above.
Could you fix this up, or drop the series so I can resubmit it?
> +
> static __always_inline u32 vdso_read_begin(const struct vdso_clock *vc)
> {
> u32 seq;
(...)