All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: John Stultz <john.stultz@linaro.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Chris Metcalf <cmetcalf@mellanox.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Prarit Bhargava <prarit@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 4/4] timekeeping: clocksource_cyc2ns: Document intended range limitation
Date: Mon, 21 Nov 2016 09:54:02 +0100	[thread overview]
Message-ID: <20161121085402.GA529@gmail.com> (raw)
In-Reply-To: <1479531014-25264-5-git-send-email-john.stultz@linaro.org>


* John Stultz <john.stultz@linaro.org> wrote:

> From: Chris Metcalf <cmetcalf@mellanox.com>
> 
> The "cycles" argument should not be an absolute clocksource cycle
> value, as the implementation's arithmetic will overflow relatively
> easily with wide (64 bit) clocksource counters.
> 
> For performance, the implementation is simple and fast, since the
> function is intended for only relatively small delta values of
> clocksource cycles.
> 
> Cc: Richard Cochran <richardcochran@gmail.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
> [jstultz: Fixed up to merge against HEAD & commit message tweaks]
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
>  include/linux/clocksource.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
> index 0839818..0881bca 100644
> --- a/include/linux/clocksource.h
> +++ b/include/linux/clocksource.h
> @@ -169,7 +169,10 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 shift_constant)
>   * @mult:	cycle to nanosecond multiplier
>   * @shift:	cycle to nanosecond divisor (power of two)
>   *
> - * Converts cycles to nanoseconds, using the given mult and shift.
> + * Converts clocksource cycles to nanoseconds, using the given mult and shift.
> + * The code is optimized for performance and not intended to work
> + * with absolute clocksource cycles, as it will easily overflow,
> + * but just intended for relative (delta) clocksource cycles.

Had to read this explanation twice, how about:

    * Converts clocksource cycles to nanoseconds, using the given @mult and @shift.
    * The code is optimized for performance and is not intended to work
    * with absolute clocksource cycles (as those will easily overflow),
    * but is only intended to be used with relative (delta) clocksource cycles.

Did I get it right?

Thanks,

	Ingo

  reply	other threads:[~2016-11-21  8:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-19  4:50 [GIT PULL][PATCH 0/4] Timekeeping items for 4.10 John Stultz
2016-11-19  4:50 ` [PATCH 1/4] time: alarmtimer: Add the trcepoints for alarmtimer John Stultz
2016-11-21  8:13   ` Ingo Molnar
2016-11-21  8:46     ` Baolin Wang
2016-11-21  8:56       ` Thomas Gleixner
2016-11-21  9:02         ` Baolin Wang
2016-11-19  4:50 ` [PATCH 2/4] selftests/timers: Fix spelling mistake "Asyncrhonous" -> "Asynchronous" John Stultz
2016-11-19  4:50 ` [PATCH 3/4] timekeeping: Ignore the bogus sleep time if pm_trace is enabled John Stultz
2016-11-21  8:17   ` Ingo Molnar
2016-11-24  9:54     ` Chen, Yu C
2016-11-28 18:39       ` John Stultz
2016-11-28 23:45         ` Chen, Yu C
2016-11-19  4:50 ` [PATCH 4/4] timekeeping: clocksource_cyc2ns: Document intended range limitation John Stultz
2016-11-21  8:54   ` Ingo Molnar [this message]
2016-11-21 15:28     ` Chris Metcalf
2016-11-21 22:06       ` John Stultz

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=20161121085402.GA529@gmail.com \
    --to=mingo@kernel.org \
    --cc=cmetcalf@mellanox.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prarit@redhat.com \
    --cc=richardcochran@gmail.com \
    --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 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.