public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Salisbury <mbs@mc.com>
To: george anzinger <george@mvista.com>
Cc: Jamie Lokier <lk@tantalophile.demon.co.uk>,
	Ben Greear <greearb@candelatech.com>,
	Horst von Brand <vonbrand@sleipnir.valparaiso.cl>,
	linux-kernel@vger.kernel.org,
	high-res-timers-discourse@lists.sourceforge.net
Subject: Re: No 100 HZ timer!
Date: Tue, 17 Apr 2001 08:51:32 -0400	[thread overview]
Message-ID: <01041710225227.01893@pc-eng24.mc.com> (raw)
In-Reply-To: <200104131205.f3DC5KV11393@sleipnir.valparaiso.cl> <0104160841431V.01893@pc-eng24.mc.com> <3ADB45C0.E3F32257@mvista.com>
In-Reply-To: <3ADB45C0.E3F32257@mvista.com>

> Functional Specification for the high-res-timers project.
> 
> In addition we expect that we will provide a high resolution timer for
> kernel use (heck, we may provide several).
 
what we do here determines what we can do for the user..

> We will provide several "clocks" as defined by the standard.  In
> particular, the following capabilities will be attached to some clock,
> regardless of the actual clock "name" we end up using:
> 
> CLOCK_10MS a wall clock supporting timers with 10 ms resolution (same as
> linux today). 
> 
> CLOCK_HIGH_RES a wall clock supporting timers with the highest
> resolution the hardware supports.
> 
> CLOCK_1US a wall clock supporting timers with 1 micro second resolution
> (if the hardware allows it).
> 
> CLOCK_UPTIME a clock that give the system up time.  (Does this clock
> need to support timers?)
> 
> CLOCK_REALTIME a wall clock supporting timers with 1/HZ resolution.
> 

Too many clocks.  we should have CLOCK_REALTIME and CLOCK_UPTIME for sure, but
the others are just fluff.  we should have 1 single clock mechanism for the
whole system with it's resolution and tick/tickless characteristics determined
at compile time.

also CLOCK_UPTIME should be the "true" clock, with CLOCK_REALTIME just a
convenience/compliance offset.



> At the same time we will NOT support the following clocks:
> 
> CLOCK_VIRTUAL a clock measuring the elapsed execution time (real or
> wall) of a given task.  
> 
> CLOCK_PROFILE a clock used to generate profiling events. 
> 
> CLOCK_???  any clock keyed to a task.

we could do some KOOL things here but they are more related to process time
accounting and should be dealt with in that context and as a separate project.

however our design should take these concepts into account and allow for easy
integration of these types of functionality.

> 
> (Note that this does not mean that the clock system will not support the
> virtual and profile clocks, but that they will not be accessible thru
> the POSIX timer interface.)

I think that should sombody choose to implement them, they should be available
at least through the clock_xxx interfaces..

> 
> It would be NICE if we could provide a way to hook other time support
> into the system.  In particular a
> 
> CLOCK_WWV or CLOCK_GPS
> 

CLOCK_NNTP

> might be nice.  The problem with these sorts of clocks is that they
> imply an array of function pointers for each clock and function pointers
> slow the code down because of their non predictability.  Never the less,
> we will attempt to allow easy expansion in this direction.
> 
> Implications on the current kernel:
> 
> The high resolution timers will require a fast clock access with the
> maximum supported resolution in order to convert relative times to
> absolute times.  This same fast clock will be used to support the
> various user and system time requests.
> 
> There are two ways to provide timers to the kernel.  For lack of a
> better term we will refer to them as "ticked" and "tick less".  Until we
> have performance information that implies that one or the other of these
> methods is better in all cases we will provide both ticked and tick less
> systems.  The variety to be used will be selected at configure time.
> 
> For tick less systems we will need to provide code to collect execution
> times.  For the ticked system the current method of collection these
> times will be used.  This project will NOT attempt to improve the
> resolution of these timers, however, the high speed, high resolution
> access to the current time will allow others to augment the system in
> this area.

huh? why not?

> 
> For the tick less system the project will also provide a time slice
> expiration interrupt.
> 
> The timer list(s) (all pending timers) need to be organized so that the
> following operations are fast:
> 
> a.) list insertion of an arbitrary timer,
should be O(log(n)) at worst

> b.) removal of canceled and expired timers, and
easy to make O(1)

> c.) finding the timer for "NOW" and its immediate followers.
head of list or top of tree or top of heap or whatever, O(1)

> Times in the timer list will be absolute and related to system up time.
> These times will be converted to wall time as needed.
 
and ONLY when needed by users


> 
> The POSIX interface provides for "absolute" timers relative to a given

do you mean "relative" timers?

> clock.  When these timers are related to a "wall" clock they will need
> adjusting when the wall clock time is adjusted.  These adjustments are
> done for "leap seconds" and the date command.  (Note, we are keeping
> timers relative to "uptime" which can not be adjusted.  This means that
> relative timers and absolute timers related to CLOCK_UPTIME are not
> affected by the above wall time adjustments.)

absolute timers will automatically fall out when you adjust CLOCK_UPTIME...
i.e.  an absolute time is an absolute time and since CLOCK_UPTIME is the
ultimate arbiter of what absolute time it is, adjusting CLOCK_UPTIME will cause
the absolute times in the timer list to be handled properly without modifying
them. (am I makeing myself clear?  I will try to come up with a better
description of what I mean)

> In either a ticked or tick less system, it is expected that resolutions 
> higher than 1/HZ will come with some additional overhead.  For this 
> reason, the CLOCK resolution will be used to round up times for each 
> timer.  When the CLOCK provides 1/HZ (or coarser) resolution, the 
> project will attempt to meet or exceed the current systems timer 
> performance. 

ONLY in a ticked system.

> 
> Safe guards:
> 
> Given a system speed, there is a repeating timer rate which will consume
> 100% of the system in handling the timer interrupts.  An attempt will
> be made to detect this rate and adjust the timer to prevent system
> lockup.  This adjustment will look like timer overruns to the user
> (i.e. we will take a percent of the interrupts and record the untaken
> interrupts as overruns).

see my earlier e-mail, although it is a simple matter to enforce a minimum
allowable interval by parameter checking.


> 
> What the project will NOT do:
> 
> This project will NOT provide higher resolution accounting (i.e. user
> and system execution times).
> 
> The project will NOT provide higher resolution VIRTUAL or PROFILE timers.

as I said, there are some kool things we could do here, and we should design in
allowances for future upgrades which implement these things and let it get done
as a followon.



-- 
/*------------------------------------------------**
**   Mark Salisbury | Mercury Computer Systems    **
**   mbs@mc.com     | System OS - Kernel Team     **
**------------------------------------------------**
**  I will be riding in the Multiple Sclerosis    **
**  Great Mass Getaway, a 150 mile bike ride from **
**  Boston to Provincetown.  Last year I raised   **
**  over $1200.  This year I would like to beat   **
**  that.  If you would like to contribute,       **
**  please contact me.                            **
**------------------------------------------------*/


  parent reply	other threads:[~2001-04-17 14:32 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-11 17:56 No 100 HZ timer! Bret Indrelee
2001-04-12 17:39 ` george anzinger
2001-04-12 21:19   ` Bret Indrelee
2001-04-12 22:20     ` george anzinger
2001-04-13  4:00       ` Bret Indrelee
2001-04-13  6:32         ` Ben Greear
2001-04-13  8:42           ` george anzinger
2001-04-13 10:36             ` Jamie Lokier
2001-04-13 16:07               ` george anzinger
2001-04-13 23:00                 ` Jamie Lokier
2001-04-13 12:05           ` Horst von Brand
2001-04-13 21:53             ` george anzinger
2001-04-13 23:10               ` Jamie Lokier
2001-04-16  3:02                 ` Ben Greear
2001-04-16  2:46                   ` Jamie Lokier
2001-04-16 12:36                     ` Mark Salisbury
2001-04-16 19:19                       ` george anzinger
2001-04-16 20:45                         ` Albert D. Cahalan
2001-04-16 21:29                           ` Chris Wedgwood
2001-04-16 22:25                           ` george anzinger
2001-04-16 23:57                         ` Mark Salisbury
2001-04-17  0:45                           ` george anzinger
2001-04-17 12:12                             ` Mark Salisbury
2001-04-17 12:51                         ` Mark Salisbury [this message]
2001-04-17 18:53                           ` george anzinger
2001-04-17 19:41                             ` Jamie Lokier
2001-04-23  8:05                             ` Ulrich Windl
2001-04-23 13:22                               ` Mark Salisbury
2001-04-16  2:41               ` Ben Greear
  -- strict thread matches above, loose matches on Subject: below --
2001-08-01 17:22 No 100 HZ timer ! george anzinger
2001-08-01 19:34 ` Chris Friesen
2001-08-01 19:49   ` Richard B. Johnson
2001-08-01 20:08     ` Mark Salisbury
2001-08-01 20:33     ` george anzinger
2001-08-01 21:20   ` george anzinger
2001-08-02  4:28     ` Rik van Riel
2001-08-02  6:03       ` george anzinger
2001-08-02 14:39         ` Oliver Xymoron
2001-08-02 16:36           ` george anzinger
2001-08-02 17:05             ` Oliver Xymoron
2001-08-02 17:46               ` george anzinger
2001-08-02 18:41                 ` Oliver Xymoron
2001-08-02 21:18                   ` george anzinger
2001-08-02 22:09                     ` Oliver Xymoron
2001-08-02 17:26             ` John Alvord
2001-04-12 13:14 No 100 HZ timer! Bret Indrelee
2001-04-12 12:58 No 100 HZ timer ! Mark Salisbury
2001-04-11  9:06 schwidefsky
2001-04-10 14:42 schwidefsky
2001-04-10 12:54 schwidefsky
2001-04-10 11:38 schwidefsky
2001-04-10 11:54 ` Alan Cox
2001-04-10  7:29 schwidefsky
2001-04-10  7:27 schwidefsky
2001-04-09 15:54 schwidefsky
2001-04-09 18:30 ` Jeff Dike
2001-04-09 18:19   ` Mark Salisbury
2001-04-09 20:12     ` Alan Cox
2001-04-09 20:32       ` Mark Salisbury
2001-04-09 22:31       ` Mikulas Patocka
2001-04-09 22:35         ` Alan Cox
2001-04-10 11:43           ` David Schleef
2001-04-10 12:04             ` Mikulas Patocka
2001-04-10 12:31               ` David Schleef
2001-04-10 12:34                 ` Mark Salisbury
2001-04-10 14:10                 ` Mikulas Patocka
2001-04-10 13:35                   ` root
2001-04-10 14:22                   ` Andi Kleen
2001-04-10 15:43                   ` Alan Cox
2001-04-12  5:25                     ` watermodem
2001-04-12  8:45                       ` Jamie Lokier
2001-04-10 17:15                   ` Jamie Lokier
2001-04-10 17:27                     ` Alan Cox
2001-04-10 17:35                       ` Jamie Lokier
2001-04-10 18:17                         ` Alan Cox
2001-04-10 18:24                           ` Jamie Lokier
2001-04-10 19:28                             ` george anzinger
2001-04-10 20:02                               ` mark salisbury
2001-04-10 22:08                                 ` george anzinger
2001-04-11  0:48                                   ` Mark Salisbury
2001-04-11  2:35                                     ` george anzinger
2001-04-12  0:24                                       ` Mark Salisbury
2001-04-11 16:11                                     ` Jamie Lokier
2001-04-11 16:59                                       ` george anzinger
2001-04-11 18:57                                         ` Jamie Lokier
2001-04-11 19:21                                           ` John Alvord
2001-04-12  8:41                                             ` Jamie Lokier
2001-08-01  1:08                               ` george anzinger
2001-08-11 11:57                                 ` Pavel Machek
2001-08-14 15:59                                   ` Jamie Lokier
2001-08-14 16:57                                     ` george anzinger
2001-04-10 19:50                             ` Zdenek Kabelac
2001-04-11 11:42                               ` Maciej W. Rozycki
2001-04-11 16:13                                 ` Jamie Lokier
2001-04-12  9:51                                   ` Maciej W. Rozycki
2001-04-10 19:42                       ` Zdenek Kabelac
2001-04-10 12:19             ` Mark Salisbury
2001-04-10 17:51             ` yodaiken
2001-04-11 18:43           ` Oliver Xymoron
2001-04-10 12:11       ` Mark Salisbury
2001-04-10  5:51     ` Andi Kleen
2001-04-10  9:33       ` Martin Mares
2001-04-10 10:00         ` Albert D. Cahalan
2001-04-10 12:14         ` Mark Salisbury
2001-04-11  5:55           ` Karim Yaghmour
2001-04-10 11:18       ` Alan Cox
2001-04-10 12:02         ` Andi Kleen
2001-04-10 12:12           ` Alan Cox
2001-04-10 12:27             ` Mark Salisbury
2001-04-10 12:32             ` Andi Kleen
2001-04-10 12:36               ` Alan Cox
2001-04-10 12:37                 ` Andi Kleen
2001-04-10 18:45               ` Stephen D. Williams
2001-04-10 19:59                 ` Andi Kleen
2001-04-10 12:07       ` Mark Salisbury
2001-04-10 12:45         ` Andi Kleen
2001-04-10 12:42           ` Mark Salisbury
2001-04-10 12:54             ` Andi Kleen

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=01041710225227.01893@pc-eng24.mc.com \
    --to=mbs@mc.com \
    --cc=george@mvista.com \
    --cc=greearb@candelatech.com \
    --cc=high-res-timers-discourse@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lk@tantalophile.demon.co.uk \
    --cc=vonbrand@sleipnir.valparaiso.cl \
    /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