From: Tim Schmielau <tim@physik3.uni-rostock.de>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Re: [PATCH] fix nanosleep() granularity bumps
Date: Mon, 24 Mar 2003 12:10:55 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590723705298@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590723705296@msgid-missing>
> On Tue, Mar 18, 2003 at 10:05:56AM +0100, Tim Schmielau wrote:
[...]
> Suggest the attached patch as a fix instead - easier to understand I
> think and works for every possible start value. This is what I made for
> Andrea Arcangeli many years ago...
>
> diff -ur linux-2.5.65/kernel/timer.c linux-2.5.65-new/kernel/timer.c
> --- linux-2.5.65/kernel/timer.c 2003-03-17 22:44:41.000000000 +0100
> +++ linux-2.5.65-new/kernel/timer.c 2003-03-24 12:57:31.000000000 +0100
> @@ -1182,11 +1182,14 @@
> INIT_LIST_HEAD(base->tv1.vec + j);
>
> base->timer_jiffies = INITIAL_JIFFIES;
> - base->tv1.index = INITIAL_JIFFIES & TVR_MASK;
> - base->tv2.index = (INITIAL_JIFFIES >> TVR_BITS) & TVN_MASK;
> - base->tv3.index = (INITIAL_JIFFIES >> (TVR_BITS+TVN_BITS)) & TVN_MASK;
> - base->tv4.index = (INITIAL_JIFFIES >> (TVR_BITS+2*TVN_BITS)) & TVN_MASK;
> - base->tv5.index = (INITIAL_JIFFIES >> (TVR_BITS+3*TVN_BITS)) & TVN_MASK;
> + base->tv1.index = (1 + (INITIAL_JIFFIES - 1)) & TVR_MASK;
> + base->tv2.index = (1 + ((INITIAL_JIFFIES - 1) >> TVR_BITS)) & TVN_MASK;
> + base->tv3.index = (1 + ((INITIAL_JIFFIES - 1)
> + >> (TVR_BITS + TVN_BITS))) & TVN_MASK;
> + base->tv4.index = (1 + ((INITIAL_JIFFIES - 1)
> + >> (TVR_BITS + 2 * TVN_BITS))) & TVN_MASK;
> + base->tv5.index = (1 + ((INITIAL_JIFFIES - 1)
> + >> (TVR_BITS + 3 * TVN_BITS))) & TVN_MASK;
> }
>
> static int __devinit timer_cpu_notify(struct notifier_block *self,
Too late - the whole tv[1-5].index duplication is gone already after a
cleanup done by George Anzinger.
Tim
prev parent reply other threads:[~2003-03-24 12:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-24 12:06 [Linux-ia64] Re: [PATCH] fix nanosleep() granularity bumps Finn Arne Gangstad
2003-03-24 12:10 ` Tim Schmielau [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=marc-linux-ia64-105590723705298@msgid-missing \
--to=tim@physik3.uni-rostock.de \
--cc=linux-ia64@vger.kernel.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