Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1523782

Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits

From John Stultz <john.stultz@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits
Date 2016-11-16 20:50 +0100
Message-ID <sEenw-7aa-5@gated-at.bofh.it> (permalink)
References <sEbJ0-5pV-11@gated-at.bofh.it> <sEcOJ-6ob-9@gated-at.bofh.it> <sEedQ-76Q-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 16, 2016 at 11:30 AM, Chris Metcalf <cmetcalf@mellanox.com> wrote:
> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
> index 08398182f56e..5444429884b8 100644
> --- a/include/linux/clocksource.h
> +++ b/include/linux/clocksource.h
> @@ -171,6 +171,10 @@ static inline u32 clocksource_hz2mult(u32 hz, u32
> shift_constant)
>   *
>   * Converts 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.
> + *
>   * XXX - This could use some mult_lxl_ll() asm optimization

Just as a heads up, it seems your working against an older kernel, as
this didn't apply. Its simple enough to fix up, so I'll do so, but in
the future, please submit patches against something close to Linus
HEAD.

thanks
-john

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] clocksource_cyc2ns: avoid overflowing 64 bits Chris Metcalf <cmetcalf@mellanox.com> - 2016-11-16 18:00 +0100
  Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits John Stultz <john.stultz@linaro.org> - 2016-11-16 19:10 +0100
    Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits John Stultz <john.stultz@linaro.org> - 2016-11-16 20:50 +0100
      Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits John Stultz <john.stultz@linaro.org> - 2016-11-16 21:10 +0100
    Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits John Stultz <john.stultz@linaro.org> - 2016-11-16 20:50 +0100

csiph-web