Re: infinite loop in read_hpet from ktime_get_boot_fast_ns

Jason A. Donenfeld
2019-06-13T15:19:17Z

Hey Arnd, Peter,

On Wed, Jun 12, 2019 at 4:01 PM Arnd Bergmann <arnd@arndb.de> wrote:
> Documentation/core-api/timekeeping.rst describes the timekeeping
> interfaces. I think what you want here is ktime_get_coarse_boottime().
>
> Note that "coarse" means "don't access the hardware clocksource"
> here, which is faster than "fast", but less accurate.
>
> This is updated as often as "jiffies_64", but is in nanosecond resolution
> and takes suspended time into account.

Oh, thanks. Indeed ktime_get_coarse_boottime seems even better. It's
perhaps a bit slower, in that it has that seqlock, but that might give
better synchronization between CPUs as well.

Peter - any immediate downside you can think of compared to local_clock()?

Jason