mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Hilber <peter.hilber@opensynergy.com>
To: John Stultz <jstultz@google.com>
Cc: linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Stephen Boyd <sboyd@kernel.org>,
	"Christopher S. Hall" <christopher.s.hall@intel.com>
Subject: Re: [RFC PATCH 2/7] timekeeping: Fix cross-timestamp interpolation corner case decision
Date: Thu, 27 Jul 2023 12:21:46 +0200	[thread overview]
Message-ID: <e96ee63e-24c9-2d6e-7ddd-9025bca5f7dd@opensynergy.com> (raw)
In-Reply-To: <CANDhNCpN_abA6YGHuFy32pxeT06quNSVBgyXnmPW09xTLe4XAA@mail.gmail.com>

On 08.07.23 01:02, John Stultz wrote:
> On Fri, Jun 30, 2023 at 10:12 AM Peter Hilber
> <peter.hilber@opensynergy.com> wrote:
>>
>> cycle_between() decides whether get_device_system_crosststamp() will
>> interpolate for older counter readings. So far, cycle_between() checks if
>> parameter test is in the open interval (before, after), when disregarding
>> the special case before > after.
>>
>> The only cycle_between() user, get_device_system_crosststamp(), has the
>> following problem with this: If interval_start == cycles,
>> cycle_between(interval_start, cycles, now) returns false. If a
>> history_begin was supplied to get_device_system_crosststamp(), it will
>> later call cycle_between() again, with effective argument values
>> cycle_between(history_begin->cycles, cycles, cycles). Due to the test
>> against the open interval, cycle_between() returns false again, and
>> get_device_system_crosststamp() returns -EINVAL, when it could have
>> succeeded.
>>
>> Fix this by testing against the closed interval in cycle_between(). This
>> disables interpolation if interval_start == cycles. For the special case
>> before > after, similar arguments hold. Fix this in a similar way.
>>
>> At the second cycle_between() call site, add an extra condition in order to
>> effectively check a half-open interval, which keeps the condition
>> documented above the call site satisfied.
> 
> I'm having a little bit of a hard time following this commit message.
> Do you think you might be able to take another swing at it to make it
> a bit clearer?
> 
> I get you're going from exclusive to inclusive intervals, but it's not
> very clear why this change is needed.
> 

Thanks for the feedback, I'll post v2 soon and will try to come up with
a better commit message.

  reply	other threads:[~2023-07-27 10:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30 17:10 [RFC PATCH 0/7] Add virtio_rtc module and related changes Peter Hilber
2023-06-30 17:10 ` [RFC PATCH 1/7] timekeeping: Fix cross-timestamp interpolation on counter wrap Peter Hilber
2023-07-07 22:51   ` John Stultz
2023-07-27 10:21     ` Peter Hilber
2023-06-30 17:10 ` [RFC PATCH 2/7] timekeeping: Fix cross-timestamp interpolation corner case decision Peter Hilber
2023-07-07 23:02   ` John Stultz
2023-07-27 10:21     ` Peter Hilber [this message]
2023-06-30 17:10 ` [RFC PATCH 3/7] timekeeping: Fix cross-timestamp interpolation for non-x86 Peter Hilber
2023-07-07 23:31   ` John Stultz
2023-07-27 10:21     ` Peter Hilber
2023-06-30 17:10 ` [RFC PATCH 4/7] clocksource: arm_arch_timer: Export counter type, clocksource Peter Hilber
2023-07-03  8:13   ` Marc Zyngier
2023-07-27 10:22     ` Peter Hilber
2023-07-28  8:11       ` Marc Zyngier
2023-07-31 16:15         ` Peter Hilber
2023-06-30 17:10 ` [RFC PATCH 5/7] virtio_rtc: Add module and driver core Peter Hilber
2023-06-30 17:10 ` [RFC PATCH 6/7] virtio_rtc: Add PTP clocks Peter Hilber
2023-06-30 17:10 ` [RFC PATCH 7/7] 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=e96ee63e-24c9-2d6e-7ddd-9025bca5f7dd@opensynergy.com \
    --to=peter.hilber@opensynergy.com \
    --cc=christopher.s.hall@intel.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®