Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: CLOCK_TICK_RATE, was: Re: [PATCH V4 3/4] ARM: Xilinx: base header files and assembly macros
Date: Mon, 21 Feb 2011 22:51:00 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.00.1102212250290.2701@localhost6.localdomain6> (raw)
In-Reply-To: <201102212208.10231.arnd@arndb.de>

On Mon, 21 Feb 2011, Arnd Bergmann wrote:

> On Monday 21 February 2011, Russell King - ARM Linux wrote:
> > Eg, LOW_RES_NSEC is exported to userspace via the posix clocks interface.
> > 
> > NSEC_PER_SEC and TICK_NSEC are used for cmos clock updates, so probably
> > don't matter too much there.  TICK_NSEC is also used by the scheduler,
> > time conversions (timespec/timeval to/from jiffies) and profiling code.
> > 
> > NSEC_PER_JIFFY is used by the jiffy clocksource code, which only matters
> > if you don't have your own clocksource.
> > 
> > So, I feel very uneasy about saying that CLOCK_TICK_RATE doesn't matter
> > anymore given all the places which reference something that's derived
> > from it.
> 
> All the calculations based off of CLOCK_TICK_RATE are derived from ACTHZ,
> which is either the correct value based on the underlying HW timer tick,
> or slightly off, when either the HW tick or the value of CLOCK_TICK_RATE
> is not a true multiple of HZ.
> 
> In fact, I'm pretty sure that it's off on a lot of machines:
> 
> arch/frv/include/asm/timex.h:#define CLOCK_TICK_RATE            1193180 /* Underlying HZ */
> arch/m68k/include/asm/timex.h:#define CLOCK_TICK_RATE   1193180 /* Underlying HZ */
> arch/mips/include/asm/timex.h:#define CLOCK_TICK_RATE 1193182
> arch/parisc/include/asm/timex.h:#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
> arch/s390/include/asm/timex.h:#define CLOCK_TICK_RATE   1193180 /* Underlying HZ */
> arch/sh/include/asm/timex.h:#define CLOCK_TICK_RATE             1193180
> arch/x86/include/asm/timex.h:#define CLOCK_TICK_RATE            PIT_TICK_RATE
> arch/xtensa/include/asm/timex.h:#define CLOCK_TICK_RATE         1193180 /* (everyone is using this value) */
> 
> None of these is actually using a PC-style PIT these days, the just copied the
> definition blindly from old i386. I think a simple
> 
> #define ACTHZ (HZ << 8)
> 
> would fix more than it can break, and most likely nobody would ever notice
> the difference. If we do that, CLOCK_TICK_RATE becomes unused.

Indeed.

	tglx

  reply	other threads:[~2011-02-21 21:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1298052881-14591-1-git-send-email-john.linn@xilinx.com>
2011-02-18 18:14 ` [PATCH V4 1/4] ARM: Xilinx: Adding Xilinx board support John Linn
2011-02-28 11:06   ` Jamie Iles
2011-02-28 14:13     ` John Linn
     [not found] ` <1298052881-14591-2-git-send-email-john.linn@xilinx.com>
2011-02-18 18:14   ` [PATCH V4 2/4] ARM: Xilinx: Adding timer support to the platform John Linn
2011-02-28 11:11     ` Jamie Iles
2011-02-28 14:14       ` John Linn
     [not found]   ` <1298052881-14591-3-git-send-email-john.linn@xilinx.com>
2011-02-18 18:14     ` [PATCH V4 3/4] ARM: Xilinx: base header files and assembly macros John Linn
2011-02-20 21:37       ` Arnd Bergmann
2011-02-21  0:18         ` John Linn
2011-02-21  8:36           ` Arnd Bergmann
2011-02-21 14:36             ` John Linn
2011-02-21 14:48               ` Arnd Bergmann
2011-02-21 15:04                 ` John Linn
2011-02-21 15:17                 ` Russell King - ARM Linux
2011-02-21 21:08                   ` CLOCK_TICK_RATE, was: " Arnd Bergmann
2011-02-21 21:51                     ` Thomas Gleixner [this message]
2011-02-28 11:18       ` Jamie Iles
2011-02-28 14:20         ` John Linn
2011-02-28 15:01           ` Jamie Iles
2011-02-28 11:20       ` Russell King - ARM Linux
2011-02-28 14:22         ` [PATCH V4 3/4] ARM: Xilinx: base header files and assemblymacros John Linn
     [not found]     ` <1298052881-14591-4-git-send-email-john.linn@xilinx.com>
2011-02-18 18:14       ` [PATCH V4 4/4] ARM: Xilinx: Adding Xilinx platform infrastructure support John Linn

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=alpine.LFD.2.00.1102212250290.2701@localhost6.localdomain6 \
    --to=tglx@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.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