From: Jeff Garzik <jgarzik@pobox.com>
To: Sridhar Samudrala <sri@us.ibm.com>
Cc: Edgar Toernig <froese@gmx.de>,
davem@redhat.com, linux-kernel@vger.kernel.org,
netdev@oss.sgi.com
Subject: Re: [PATCH] Consolidate multiple implementations of jiffies-msecs conversions.
Date: Fri, 26 Mar 2004 14:03:01 -0500 [thread overview]
Message-ID: <40647E65.7020903@pobox.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0403261007370.6718@localhost.localdomain>
Sridhar Samudrala wrote:
> On Fri, 26 Mar 2004, Edgar Toernig wrote:
>
>
>>Sridhar Samudrala wrote:
>>
>>>The following patch to 2.6.5-rc2 consolidates 6 different implementations
>>>of msecs to jiffies and 3 different implementation of jiffies to msecs.
>>>All of them now use the generic msecs_to_jiffies() and jiffies_to_msecs()
>>>that are added to include/linux/time.h
>>>[...]
>>>-#define MSECS(ms) (((ms)*HZ/1000)+1)
>>>-return (((ms)*HZ+999)/1000);
>>>+return (msecs / 1000) * HZ + (msecs % 1000) * HZ / 1000;
>>
>>Did you check that all users of the new version will work correctly
>>with your rounding? Explicit round-up of delays is often required,
>>especially when talking to hardware...
>
>
> I don't see any issues with the 2.6 default HZ value of 1000 as they become
> no-ops and there is no need for any rounding.
> I guess you are referring to cases when HZ < 1000(ex: 100) and msecs is
> less than 10. In those cases, the new version returns 0, whereas some of the
> older versions return 1.
We'll definitely want to return 1 rather than zero, for the uses in my
drivers, at least...
Jeff
next prev parent reply other threads:[~2004-03-26 19:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-25 20:17 [PATCH] Consolidate multiple implementations of jiffies-msecs conversions Sridhar Samudrala
2004-03-25 20:32 ` David S. Miller
2004-03-25 20:36 ` Jeff Garzik
2004-03-25 21:05 ` Bill Rugolsky Jr.
2004-03-25 23:49 ` Sridhar Samudrala
2004-03-26 0:44 ` Edgar Toernig
2004-03-26 18:49 ` Sridhar Samudrala
2004-03-26 19:03 ` Jeff Garzik [this message]
2004-03-29 19:57 ` Sridhar Samudrala
2004-03-26 20:45 ` Edgar Toernig
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=40647E65.7020903@pobox.com \
--to=jgarzik@pobox.com \
--cc=davem@redhat.com \
--cc=froese@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
--cc=sri@us.ibm.com \
/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;
as well as URLs for NNTP newsgroup(s).