public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Hilber <peter.hilber@opensynergy.com>,
	linux-kernel@vger.kernel.org
Cc: John Stultz <jstultz@google.com>, Stephen Boyd <sboyd@kernel.org>,
	"Christopher S. Hall" <christopher.s.hall@intel.com>
Subject: Re: [RFC PATCH v2 2/6] timekeeping: Fix cross-timestamp interpolation corner case decision
Date: Fri, 15 Sep 2023 21:02:07 +0200	[thread overview]
Message-ID: <874jjv1cr4.ffs@tglx> (raw)
In-Reply-To: <36b2f11b-9dfd-b721-c97e-478eabceb4cf@opensynergy.com>

On Fri, Sep 15 2023 at 19:30, Peter Hilber wrote:
> On 15.09.23 18:10, Thomas Gleixner wrote:
>> So the explanation in the changelog makes some sense, but this code
>> without any further explanation just makes my brain explode.
>> 
>> This whole thing screams for a change to cycle_between() so it becomes:
>> 
>>      timestamp_in_interval(start, end, ts)
>> 
>> and make start inclusive and not exclusive, no?
>
> I tried like this in v1 (having 'end' inclusive as well), but didn't like
> the effect at the second usage site.
>
>> 
>> That's actually correct for both usage sites because for interpolation
>> the logic is the same. history_begin->cycles is a valid timestamp, no?
>
> AFAIU, with the timestamp_in_interval() change, history_begin->cycles would
> become a valid timestamp. To me it looks like
> adjust_historical_crosststamp() should then work unmodified for now. But
> one would have to be careful with the additional corner case in the future.
>
> So, document the current one-line change, or switch to
> timestamp_in_interval()?

I really prefer the consistent function which treats the start as
inclusive as that makes the most sense and is self explanatory.

Thanks,

        tglx

  reply	other threads:[~2023-09-15 19:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-18  1:20 [RFC PATCH v2 0/6] Add virtio_rtc module and related changes Peter Hilber
2023-08-18  1:20 ` [RFC PATCH v2 1/6] timekeeping: Fix cross-timestamp interpolation on counter wrap Peter Hilber
2023-08-18  1:20 ` [RFC PATCH v2 2/6] timekeeping: Fix cross-timestamp interpolation corner case decision Peter Hilber
2023-08-25  4:02   ` John Stultz
2023-09-15 16:10   ` Thomas Gleixner
2023-09-15 17:30     ` Peter Hilber
2023-09-15 19:02       ` Thomas Gleixner [this message]
2023-08-18  1:20 ` [RFC PATCH v2 3/6] timekeeping: Fix cross-timestamp interpolation for non-x86 Peter Hilber
2023-08-25  4:04   ` John Stultz
2023-09-13  9:11     ` Peter Hilber
2023-08-18  1:20 ` [RFC PATCH v2 4/6] virtio_rtc: Add module and driver core Peter Hilber
2023-08-18  1:20 ` [RFC PATCH v2 5/6] virtio_rtc: Add PTP clocks Peter Hilber
2023-08-18  1:20 ` [RFC PATCH v2 6/6] virtio_rtc: Add Arm Generic Timer cross-timestamping Peter Hilber

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=874jjv1cr4.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=christopher.s.hall@intel.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hilber@opensynergy.com \
    --cc=sboyd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox