All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Stultz <jstultz@google.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Stephen Boyd <sboyd@kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] sched_clock: Round the frequency reported to nearest rather than down
Date: Tue, 26 Apr 2022 13:38:40 -0700	[thread overview]
Message-ID: <CANDhNCrQQ5cUYzSr8pTdfbpvRrwJxWtTZxqvkGGdZiPXkfvr1Q@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2204240055590.9383@angie.orcam.me.uk>

On Sun, Apr 24, 2022 at 4:47 AM Maciej W. Rozycki <macro@orcam.me.uk> wrote:
>
> We currently round the frequency reported for clock sources down, which
> gives misleading figures, e.g.:
>
> I/O ASIC clock frequency 24999480Hz
> clocksource: dec-ioasic: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76452008078 ns
> sched_clock: 32 bits at 24MHz, resolution 40ns, wraps every 85901132779ns
> MIPS counter frequency 59998512Hz
> clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 31855130776 ns
> sched_clock: 32 bits at 59MHz, resolution 16ns, wraps every 35792281591ns
>
> Rounding to nearest seems more adequate:
>
> I/O ASIC clock frequency 24999664Hz
> clocksource: dec-ioasic: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 76451445358 ns
> sched_clock: 32 bits at 25MHz, resolution 40ns, wraps every 85900499947ns
> MIPS counter frequency 59999728Hz
> clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 31854485176 ns
> sched_clock: 32 bits at 60MHz, resolution 16ns, wraps every 35791556599ns
>
> Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
> Fixes: 112f38a4a316 ("ARM: sched_clock: provide common infrastructure for sched_clock()")
> ---

This seems sane to me.

Acked-by: John Stultz <jstultz@google.com>

thanks
-john

  reply	other threads:[~2022-04-26 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24 11:47 [PATCH 0/3] sched_clock: Fixes for frequency reporting Maciej W. Rozycki
2022-04-24 11:47 ` [PATCH 1/3] sched_clock: Round the frequency reported to nearest rather than down Maciej W. Rozycki
2022-04-26 20:38   ` John Stultz [this message]
2022-05-02 12:31   ` [tip: timers/core] time/sched_clock: " tip-bot2 for Maciej W. Rozycki
2022-04-24 11:47 ` [PATCH 2/3] sched_clock: Use Hz as the unit for clock rate reporting below 4kHz Maciej W. Rozycki
2022-05-02 12:31   ` [tip: timers/core] time/sched_clock: " tip-bot2 for Maciej W. Rozycki
2022-04-24 11:47 ` [PATCH 3/3] sched_clock: Fix formatting of frequency reporting code Maciej W. Rozycki
2022-04-26 20:41   ` John Stultz
2022-05-02 12:31   ` [tip: timers/core] time/sched_clock: " tip-bot2 for Maciej W. Rozycki

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=CANDhNCrQQ5cUYzSr8pTdfbpvRrwJxWtTZxqvkGGdZiPXkfvr1Q@mail.gmail.com \
    --to=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=macro@orcam.me.uk \
    --cc=mingo@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 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.