public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Kegel <dank@alumni.caltech.edu>
To: linux-kernel@vger.rutgers.edu
Cc: Egil Kvaleberg <egil@kvaleberg.no>
Subject: Re: [PATCH] HZ change for ix86
Date: Thu, 07 Jan 1999 09:56:39 -0800	[thread overview]
Message-ID: <3694F557.FC0B5156@alumni.caltech.edu> (raw)
In-Reply-To: %gPxk2ciEs@draugen.kvaleberg.no

Egil Kvaleberg schrieb:
> IMHO, the right thing would be to implement CLK_TCK properly as a true
> reflection of HZ. Now, it seems to be fixed: e.g. 100 for i386, and 1024
> for alpha.
> 
> The easiest approach would be to make "timebits.h" pick up HZ from the
> kernel, thus:
>         #include <asm/param.h>
>         #define CLK_TCK HZ
> The downside is of course that programs would need to be recompiled for any
> change in HZ. 
> The best thing would be to fix CLK_TCK at runtime. 
e.g.
          #define CLK_TCK new_function_to_get_HZ()
> But could this possibly break anything?

Yes, it would break user programs that were compiled before your change.
I know of two ways for user code to access system time right now: 
clock() and times().  Both of these have constants (CLOCKS_PER_SECOND and
CLK_TCK)
that can't be changed without breaking user applications.
IMHO we need to leave those alone.  I don't want to have to recompile my apps
to move them from 2.0.36 to 2.2.0.  (I do like the idea of changing
HZ to a power-of-two multiple of CLK_TCK.)

Maybe we should create a new interface for user applications to get the true 
system time in its native units, with the value of the native tick available 
at runtime only.  e.g. long sys_ticks(), long sys_ticks_per_second().
- Dan
-- 
Speaking only for myself, not for my employer

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

      reply	other threads:[~1999-01-08  8:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-05  8:48 [PATCH] HZ change for ix86 Kurt Garloff
1999-01-06  3:57 ` Benjamin Scherrey
1999-01-06  9:41   ` Kurt Garloff
1999-01-07  9:54   ` Chris Wedgwood
1999-01-06  5:25 ` B. James Phillippe
1999-01-06  9:29   ` Kurt Garloff
1999-01-07 13:09     ` Pavel Machek
1999-01-08 14:14       ` Richard B. Johnson
1999-01-08 22:23         ` Kurt Garloff
1999-01-07  9:56   ` Chris Wedgwood
1999-01-07 17:38   ` Riley Williams
1999-01-06  8:21 ` Egil Kvaleberg
1999-01-07 17:56   ` Dan Kegel [this message]

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=3694F557.FC0B5156@alumni.caltech.edu \
    --to=dank@alumni.caltech.edu \
    --cc=egil@kvaleberg.no \
    --cc=linux-kernel@vger.rutgers.edu \
    /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