netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Margit Schubert-While <margitsw@t-online.de>,
	netdev@oss.sgi.com, kj <kernel-janitors@osdl.org>
Subject: Re: [patch 8/8] prism54/islpci_dev: replace schedule_timeout() with msleep()
Date: Thu, 2 Sep 2004 16:09:49 +0000	[thread overview]
Message-ID: <20040902160948.GA1944@us.ibm.com> (raw)
In-Reply-To: <20040902082432.GA1876@stro.at>

On Thu, Sep 02, 2004 at 10:24:33AM +0200, maximilian attems wrote:
> On Thu, 02 Sep 2004, Margit Schubert-While wrote:
> 
> > I agree with Jean and add the following :
> > You are assuming HZ = 1000.
> > In 2.4, HZ = 100 (And in 2.6, HZ is not necessarily = 1000).

As the original author of the patches, I feel I should interject . . .
Why/Where do you see an assumption about the value of HZ? The conversion
of the parameter to schedule_timeout() from jiffies to msecs is the only
place I can see where that might appear to be the case. But, upon closer
examination, there is no such assumption:

1000 = the number of milliseconds in a second.
HZ = the number of jiffies in a second (regardless of architecture)

In the original code for prism54/islpci_dev.c:

set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(50*HZ/1000);

Thus, to convert (50*HZ/1000) from jiffies to msecs, multiply by 1000
and divide by HZ, or:

50*HZ/1000 jiffies * 1000/HZ msecs/jiffie = 50 msecs.

And thus, in the patched code, the above becomes:

msleep(50);

Does that clear things up?

-Nish

  reply	other threads:[~2004-09-02 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-02  6:50 [patch 8/8] prism54/islpci_dev: replace schedule_timeout() with msleep() Margit Schubert-While
2004-09-02  8:24 ` [Kernel-janitors] " maximilian attems
2004-09-02 16:09   ` Nishanth Aravamudan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-09-02 17:52 Margit Schubert-While
2004-09-02 18:27 ` Nishanth Aravamudan
2004-09-02 17:30 Margit Schubert-While
2004-09-02 10:21 Margit Schubert-While
2004-09-02  9:35 Margit Schubert-While
2004-09-02 10:03 ` maximilian attems
2004-09-01 21:06 janitor

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=20040902160948.GA1944@us.ibm.com \
    --to=nacc@us.ibm.com \
    --cc=kernel-janitors@osdl.org \
    --cc=margitsw@t-online.de \
    --cc=netdev@oss.sgi.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).