All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Clemens Ladisch <clemens@ladisch.de>,
	Sultan Alsawaf <sultan@kerneltoast.com>,
	Waiman Long <longman@redhat.com>, X86 ML <x86@kernel.org>
Subject: Re: infinite loop in read_hpet from ktime_get_boot_fast_ns
Date: Thu, 13 Jun 2019 17:40:15 +0200	[thread overview]
Message-ID: <CAK8P3a3DpRvk1Mw_MKs8wAbRJbMUQoY2UTgK1CF8UOiBQg=btw@mail.gmail.com> (raw)
In-Reply-To: <CAHmME9pOWk_ZteUZc_PT19rMn1kfYcXtmLcyAy5sncdV1tNuiQ@mail.gmail.com>

On Thu, Jun 13, 2019 at 5:19 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
>
> 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.

A seqlock is a very cheap synchronization primitive, I would actually
guess that this is faster than most implementations of sched_clock()
that access a hardware register for reading the time.

       Arnd

  reply	other threads:[~2019-06-13 15:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07 14:14 infinite loop in read_hpet from ktime_get_boot_fast_ns Jason A. Donenfeld
2019-06-11 21:09 ` Thomas Gleixner
2019-06-11 21:40   ` Waiman Long
2019-06-12  9:02   ` Peter Zijlstra
2019-06-12  9:44     ` Jason A. Donenfeld
2019-06-12 12:28       ` Peter Zijlstra
2019-06-12 12:31         ` Peter Zijlstra
2019-06-12 12:58         ` Jason A. Donenfeld
2019-06-12 15:27           ` Peter Zijlstra
2019-06-12 19:46         ` Arnd Bergmann
2019-06-18 17:34         ` Jason A. Donenfeld
2019-06-12 14:01       ` Arnd Bergmann
2019-06-13 15:18         ` Jason A. Donenfeld
2019-06-13 15:40           ` Arnd Bergmann [this message]
2019-06-13 16:17             ` Jason A. Donenfeld
2019-06-13 16:26               ` Thomas Gleixner
2019-06-13 16:34                 ` Jason A. Donenfeld
2019-06-13 16:41                   ` Jason A. Donenfeld
2019-06-13 19:53                   ` Thomas Gleixner
2019-06-14  9:14                     ` Jason A. Donenfeld
2019-06-14  9:44                       ` Thomas Gleixner
2019-06-14  9:56                         ` Jason A. Donenfeld
2019-06-14  9:48                       ` [PATCH] timekeeping: add get_jiffies_boot_64() for jiffies including sleep Jason A. Donenfeld
2019-06-14  9:55                     ` [tip:timers/urgent] timekeeping: Repair ktime_get_coarse*() granularity tip-bot for Thomas Gleixner
2019-06-14 11:18                       ` Arnd Bergmann
2019-06-12  9:29   ` infinite loop in read_hpet from ktime_get_boot_fast_ns Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a3DpRvk1Mw_MKs8wAbRJbMUQoY2UTgK1CF8UOiBQg=btw@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=Jason@zx2c4.com \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sultan@kerneltoast.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.