From: Neil Conway <nconway.list@ukaea.org.uk>
To: rml@tech9.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.4: variable HZ
Date: Fri, 18 Oct 2002 12:51:37 +0100 [thread overview]
Message-ID: <3DAFF5C9.807BE885@ukaea.org.uk> (raw)
Hiya... Nice patch, must try it when I find a few minutes - I think I
have a few apps that are limited by select/poll behaviour.
I was looking at your jiffies_to_clock_t() macro, and I notice that it
will screw up badly if the user chooses a HZ value that isn't a multiple
of the normal value (e.g. 1000 is OK, 512 isn't).
How about tweaking the macro a little? Instead of:
x / (HZ/USER_HZ)
you could use:
(x/HZ*USER_HZ + x%HZ*USER_HZ/HZ)
which minimises roundoff error and also won't overflow (at least, it
won't overflow as long as HZ*USER_HZ doesn't overflow!).
You could even use both versions of the macro, choosing between them at
compile time depending on whether or not (HZ % USER_HZ == 0).
What do you think?
cheers
Neil
PS: I'm off-list.
next reply other threads:[~2002-10-18 11:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-18 11:51 Neil Conway [this message]
2002-10-18 18:44 ` [PATCH] 2.4: variable HZ Robert Love
2002-10-18 19:38 ` Richard B. Johnson
2002-10-19 7:04 ` jdow
2002-10-21 13:13 ` Richard B. Johnson
2002-10-19 9:36 ` Willy Tarreau
2002-10-21 8:15 ` Neil Conway
-- strict thread matches above, loose matches on Subject: below --
2002-10-15 6:03 Robert Love
2002-10-15 6:50 ` Robert Love
2002-10-18 18:27 ` 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=3DAFF5C9.807BE885@ukaea.org.uk \
--to=nconway.list@ukaea.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@tech9.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.