Re: [PATCH 1/4] time: Clean up CLOCK_MONOTONIC_RAW time handling

From: Will Deacon
Date: Wed Jun 21 2017 - 05:36:44 EST


On Tue, Jun 20, 2017 at 10:21:30PM -0700, John Stultz wrote:
> Now that we fixed the sub-ns handling for CLOCK_MONOTONIC_RAW,
> remove the duplicitive tk->raw_time.tv_nsec, which can be
> stored in tk->tkr_raw.xtime_nsec (similarly to how its handled
> for monotonic time).
>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Miroslav Lichvar <mlichvar@xxxxxxxxxx>
> Cc: Richard Cochran <richardcochran@xxxxxxxxx>
> Cc: Prarit Bhargava <prarit@xxxxxxxxxx>
> Cc: Stephen Boyd <stephen.boyd@xxxxxxxxxx>
> Cc: Kevin Brodsky <kevin.brodsky@xxxxxxx>
> Cc: Will Deacon <will.deacon@xxxxxxx>
> Cc: Daniel Mentz <danielmentz@xxxxxxxxxx>
> Tested-by: Daniel Mentz <danielmentz@xxxxxxxxxx>
> Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx>
> ---
> arch/arm64/kernel/vdso.c | 6 ++---
> include/linux/timekeeper_internal.h | 4 ++--
> kernel/time/timekeeping.c | 45 ++++++++++++++++++++-----------------
> 3 files changed, 29 insertions(+), 26 deletions(-)
>
> diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
> index d0cb007..7492d90 100644
> --- a/arch/arm64/kernel/vdso.c
> +++ b/arch/arm64/kernel/vdso.c
> @@ -220,10 +220,8 @@ void update_vsyscall(struct timekeeper *tk)
> if (!use_syscall) {
> /* tkr_mono.cycle_last == tkr_raw.cycle_last */
> vdso_data->cs_cycle_last = tk->tkr_mono.cycle_last;
> - vdso_data->raw_time_sec = tk->raw_time.tv_sec;
> - vdso_data->raw_time_nsec = (tk->raw_time.tv_nsec <<
> - tk->tkr_raw.shift) +
> - tk->tkr_raw.xtime_nsec;
> + vdso_data->raw_time_sec = tk->raw_sec;
> + vdso_data->raw_time_nsec = tk->tkr_raw.xtime_nsec;
> vdso_data->xtime_clock_sec = tk->xtime_sec;
> vdso_data->xtime_clock_nsec = tk->tkr_mono.xtime_nsec;
> vdso_data->cs_mono_mult = tk->tkr_mono.mult;

For this arm64 bit:

Acked-by: Will Deacon <will.deacon@xxxxxxx>

Will