Re: [PATCH v2] timekeeping: get_jiffies_boot_64() for jiffies that include sleep time

From: Jason A. Donenfeld
Date: Wed Jun 19 2019 - 16:12:17 EST


On Wed, Jun 19, 2019 at 10:02 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
> > get_jiffies_boot_64 26
> > ktime_get_coarse_boottime 26
> > ktime_get_boot_fast_ns with tsc 70
> > ktime_get_boot_fast_ns with hpet 4922
> > ktime_get_boot_fast_ns with acpi_pm 1884
> >
> > As expected, hpet is really quite painful.
>
> I would prefer not to add the new interface then. We might in
> fact move users of get_jiffies_64() to ktime_get_coarse() for
> consistency given the small overhead of that function.

In light of the measurements, that seems like a good plan to me.

One thing to consider with moving jiffies users over that way is
ktime_t. Do you want to introduce helpers like
ktime_get_boot_coarse_ns(), just like there is already with the other
various functions like ktime_get_boot_ns(), ktime_get_boot_fast_ns(),
etc? (I'd personally prefer using the _ns variants, at least.) I can
send a patch for this.

Jason