All of lore.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <domen@coderock.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: axboe@suse.de, linux-kernel@vger.kernel.org,
	Nishanth Aravamudan <nacc@us.ibm.com>
Subject: Re: [patch 04/12] block/xd: replace schedule_timeout() with msleep()
Date: Tue, 21 Jun 2005 15:21:00 +0200	[thread overview]
Message-ID: <20050621132100.GL3906@nd47.coderock.org> (raw)
In-Reply-To: <Pine.LNX.4.61L.0506211233490.9446@blysk.ds.pg.gda.pl>

On 21/06/05 12:39 +0100, Maciej W. Rozycki wrote:
> On Mon, 20 Jun 2005 domen@coderock.org wrote:
> 
> > From: Nishanth Aravamudan <nacc@us.ibm.com>
> > 
> > 
> > 
> > Use msleep() instead of schedule_timeout() to guarantee the task
> > delays as expected. The current code wishes to sleep for 1 jiffy, but I am not
> > sure if this is actually intended, as with the change to HZ=1000, the time
> > equivalent of 1 jiffy changed from 10ms to 1ms. I have assumed the former in
> > this case; however the patch can be easily changed to assume the latter.
> [...]
> > @@ -529,10 +530,8 @@ static inline u_char xd_waitport (u_shor
> >  	int success;
> >  
> >  	xdc_busy = 1;
> > -	while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry)) {
> > -		set_current_state(TASK_UNINTERRUPTIBLE);
> > -		schedule_timeout(1);
> > -	}
> > +	while ((success = ((inb(port) & mask) != flags)) && time_before(jiffies, expiry))
> > +		msleep(10);
> >  	xdc_busy = 0;
> >  	return (success);
> >  }
> 
>  I think it's obvious what this code intends and this makes the function 
> to busy-loop instead of giving up the CPU friendly.  The change makes no 
> sense -- the code is correct as is.

mdelay - busy loop
msleep - schedule

> 
>  Maciej

  reply	other threads:[~2005-06-21 13:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20 21:51 [patch 04/12] block/xd: replace schedule_timeout() with msleep() domen
2005-06-21 11:39 ` Maciej W. Rozycki
2005-06-21 13:21   ` Domen Puncer [this message]
2005-06-21 13:53     ` Maciej W. Rozycki
2005-06-21 16:14       ` Nishanth Aravamudan
2005-06-21 16:43         ` Maciej W. Rozycki
2005-06-21 18:29           ` Nishanth Aravamudan

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=20050621132100.GL3906@nd47.coderock.org \
    --to=domen@coderock.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@linux-mips.org \
    --cc=nacc@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 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.