mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <christoph@lameter.com>
To: john stultz <johnstul@us.ibm.com>
Cc: Tim Schmielau <tim@physik3.uni-rostock.de>,
	george anzinger <george@mvista.com>,
	Andrew Morton <akpm@osdl.org>,
	OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	albert@users.sourceforge.net, lkml <linux-kernel@vger.kernel.org>,
	voland@dmz.com.pl, nicolas.george@ens.fr,
	kaukasoi@elektroni.ee.tut.fi, david+powerix@blue-labs.org
Subject: Re: [RFC] New timeofday implementation proposal
Date: Wed, 1 Sep 2004 16:16:09 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0409011601230.9794@server.home> (raw)
In-Reply-To: <1092773633.2429.176.camel@cog.beaverton.ibm.com>

On Tue, 17 Aug 2004, john stultz wrote:

> o Consolidates a large amount of code:
> 	Allows for shared times source implementations, such as: i386, x86-64
> and ia64 all use HPET, i386 and x86-64 both have ACPI PM timers, and
> i386 and ia64 both have cyclone counters. Time sources are just drivers!
> Also work for user space gettimeofday implementations will be able to be
> shared across all arches (assuming the hardware time source can be
> safely accessed from user space).

What about a hardware time source that can be safely accessed with a fast
system call (f.e. via epc on IA64)? My tests indicate that such an
implementation is comparable to a user space memory mapped solution. The
user space memory mapping might generate complexities. Especially since
the page mapped for a memory mapped timer may allow access to hardware
information that should not be exposed to user space.

The time interpolator patches that I posted a while back provide a
generic interface to timer registers / values which may be useful to what
you are trying to accomplish. The C code for that patch is platform
independent but there is also an asm fast path that is specific to IA64.
Other arches could develop similar fastpaths.

> o Uses nanoseconds as the kernel's base time unit.
> 	Rather then doing ugly manipulations to timevals or timespecs, this
> simplifies math, and gives us plenty of room to grow (64bits of
> nanoseconds ~= 584 years).

The nanoseconds patch that was accepted into 2.6.9-rc1 does do that
partially by providing a getnstimeofday and centralizing the instances
where microseconds are multiplied by 1000 get to nanoseconds.

> o Have to convert back to time_val for syscall interface

This is mostly covered by gettimeofday()

> o ntp_scale(ns):  scales ns by NTP scaling factor
> 	- costly, but correct.

May we would need 128bit arithmetic to increase the accurary of the
scaling?

> o Some arches (arm, for example) do not have high res  timing hardware
> 	- In this case we can have a "jiffies" timesource
> 		- cyc2ns(x) =  x*(NSEC_PER_SEC/HZ)
> 		- doesn't work for tickless systems

Most arches have already high res time sources. I think we just need to
make proper use of them.

> o suspend/resume
> 	- need to pause and restart the timesource reads
> 	- we don't want a gigantic or negative offset!

Some intelligent timer needs to survive the suspend. Timers may need an
attribute to show if they continue counting through suspense/resume etc
(various power conditions etc....)

Hope this helps ....

  parent reply	other threads:[~2004-09-01 23:21 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-22 23:57 boot time, process start time, and NOW time Albert Cahalan
2004-06-28 17:56 ` OGAWA Hirofumi
2004-08-16 19:41   ` Andrew Morton
2004-08-16 21:49     ` john stultz
2004-08-16 23:08     ` Tim Schmielau
2004-08-16 23:56       ` Tim Schmielau
2004-08-17  0:21       ` john stultz
2004-08-17  0:37         ` George Anzinger
2004-08-17  0:49           ` john stultz
2004-08-17  0:31       ` George Anzinger
2004-08-16 22:32         ` Albert Cahalan
2004-08-17  1:26           ` George Anzinger
2004-08-16 23:08             ` Albert Cahalan
2004-08-17  1:54               ` James Courtier-Dutton
2004-08-17  2:03                 ` Lee Revell
2004-08-17 20:52                 ` George Anzinger
2004-08-17  6:56         ` Tim Schmielau
2004-08-17 20:07           ` john stultz
2004-08-17 20:13             ` [RFC] New timeofday implementation proposal john stultz
2004-08-17 20:58               ` [RFC] New timeofday code john stultz
2004-09-01 23:16               ` Christoph Lameter [this message]
2004-08-16 23:24     ` boot time, process start time, and NOW time Albert Cahalan
2004-08-17 19:00       ` john stultz
2004-08-17 17:41         ` Albert Cahalan
2004-08-17 20:58           ` john stultz
2004-08-17 20:25     ` [PATCH] " Tim Schmielau
2004-08-17 22:24       ` George Anzinger
2004-08-17 22:37         ` john stultz
2004-08-17 23:07           ` Tim Schmielau
2004-08-18  0:11             ` john stultz
2004-08-17 22:19               ` Albert Cahalan
2004-08-18  1:09                 ` john stultz
2004-08-17 22:45                   ` Albert Cahalan
2004-08-18  7:42                   ` Tim Schmielau
2004-08-19 19:15                     ` Petri Kaukasoina
2004-08-26 11:04                       ` Andrew Morton
2004-08-26 12:07                         ` Tim Schmielau
2004-08-30 23:00                           ` Tim Schmielau
2004-08-30 23:38                             ` john stultz
2004-08-31  0:37                               ` Albert Cahalan
2004-08-31  0:49                                 ` Tim Schmielau
2004-08-31  0:45                               ` Tim Schmielau
2004-08-31  1:23                                 ` john stultz
2004-08-31  1:34                             ` john stultz
2004-08-31  6:07                               ` Tim Schmielau
2004-08-31 19:27                                 ` George Anzinger
2004-08-31 20:56                                   ` john stultz
2004-08-31 21:10                                     ` David Ford
2004-09-02 20:39                                     ` George Anzinger
2004-09-01 19:14                                 ` OGAWA Hirofumi
2004-09-02 20:58                                   ` George Anzinger
2004-09-02 21:38                                     ` OGAWA Hirofumi
2004-09-03  0:59                                       ` George Anzinger
2004-09-03  3:35                                         ` OGAWA Hirofumi
2004-09-03  7:31                                           ` George Anzinger
2004-09-03  7:51                                             ` Tim Schmielau
2004-09-03  7:15                                       ` Tim Schmielau

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=Pine.LNX.4.58.0409011601230.9794@server.home \
    --to=christoph@lameter.com \
    --cc=akpm@osdl.org \
    --cc=albert@users.sourceforge.net \
    --cc=david+powerix@blue-labs.org \
    --cc=george@mvista.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=johnstul@us.ibm.com \
    --cc=kaukasoi@elektroni.ee.tut.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.george@ens.fr \
    --cc=tim@physik3.uni-rostock.de \
    --cc=voland@dmz.com.pl \
    /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®