netdev
[Top] [All Lists]

Re: [patch 8/8] prism54/islpci_dev: replace schedule_timeout() with msle

To: Margit Schubert-While <margitsw@xxxxxxxxxxx>, netdev@xxxxxxxxxxx, kj <kernel-janitors@xxxxxxxx>
Subject: Re: [patch 8/8] prism54/islpci_dev: replace schedule_timeout() with msleep()
From: Nishanth Aravamudan <nacc@xxxxxxxxxx>
Date: Thu, 2 Sep 2004 16:09:49 +0000
In-reply-to: <20040902082432.GA1876@xxxxxxx>
References: <200409020850.38177.margitsw@xxxxxxxxxxx> <20040902082432.GA1876@xxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040803i
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

<Prev in Thread] Current Thread [Next in Thread>