From: Ralf Baechle <ralf@linux-mips.org>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: linux-mips@linux-mips.org
Subject: Re: [MIPS] Fix and cleanup the MIPS part of the (ab)use of CLOCK_TICK_RATE.
Date: Wed, 7 Nov 2007 14:17:57 +0000 [thread overview]
Message-ID: <20071107141757.GB1022@linux-mips.org> (raw)
In-Reply-To: <20071107.231036.75185559.anemo@mba.ocn.ne.jp>
On Wed, Nov 07, 2007 at 11:10:36PM +0900, Atsushi Nemoto wrote:
> The CLOCK_TICK_RATE is used for ACTHZ, TICK_NSEC, etc.
>
> At least for i8253-free platforms, It looks a value multiple of HZ
> would be better for such constants, assuming we have dyntick or
> accurate HZ clockevents.
>
> How about something like this?
>
> diff --git a/include/asm-mips/timex.h b/include/asm-mips/timex.h
> index 5816ad1..e9622b6 100644
> --- a/include/asm-mips/timex.h
> +++ b/include/asm-mips/timex.h
> @@ -18,7 +18,11 @@
> * So keeping it defined to the number for the PIT is the only sane thing
> * for now.
> */
> +#ifdef CONFIG_I8253
> #define CLOCK_TICK_RATE 1193182
> +#else
> +#define CLOCK_TICK_RATE 1024000 /* multiple of HZ */
> +#endif
kernel/time/ntp.c:#define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE)
kernel/time/ntp.c: (s64)CLOCK_TICK_RATE)
drivers/char/vt_ioctl.c: arg = CLOCK_TICK_RATE / arg;
drivers/char/vt_ioctl.c: count = CLOCK_TICK_RATE / count;
There is so much abuse of this variable, it's not even funny. It really
deserve to be taken out and shot. And that's just two cases.
Ralf
prev parent reply other threads:[~2007-11-07 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <S20025770AbXKAPqq/20071101154646Z+4363@ftp.linux-mips.org>
2007-11-07 14:10 ` [MIPS] Fix and cleanup the MIPS part of the (ab)use of CLOCK_TICK_RATE Atsushi Nemoto
2007-11-07 14:17 ` Ralf Baechle [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=20071107141757.GB1022@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-mips@linux-mips.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