From: Davin McCall <davmac@ozonline.com.au>
To: Davin McCall <davmac@ozonline.com.au>
Cc: B.Zolnierkiewicz@elka.pw.edu.pl, linux-kernel@vger.kernel.org,
linux-ide@vger.kernel.org
Subject: Re: [PATCH] various IDE patches/cleanups
Date: Fri, 30 Jan 2004 14:30:41 +1100 [thread overview]
Message-ID: <20040130143041.1eb70817.davmac@ozonline.com.au> (raw)
In-Reply-To: <20040130142725.1a408f9e.davmac@ozonline.com.au>
2nd patch notes
---------------
The function "ide_stall_queue" is used to "give back excess bandwidth" for
a drive. What this means is that some request comes in a drive, and it is
unable to process the request immediately (because the hardware is still
seeking or powering up or somesuch) then, instead of just waiting for the
hardware, we can stall the queue. See drivers/ide/ide-cdrom.c for example.
The intention would seem to be to stall the drive - there doesn't seem to
be any necessity to stall other drives in the same hwgroup (or even on the
same interface). But this is exactly what the current code does.
This patch changes the behaviour to stall only the drive, not the whole
hwgroup.
- (ide-io.c)
- ide_do_request()
- Set hwgroup->busy false when sleeping, so that requests on other drives
can still come in.
- if no requests can be served (choose_drive returns NULL) and we are
already sleeping, break out early (after setting ->busy false)
- if a request is chosen (choose_drive) and ->sleeping is currently set,
remove the expiry timer and clear ->sleeping.
- ide_timer_expiry()
- no need to clear ->busy when the sleep timer expires, as we now sleep
with ->busy clear.
diff -urN linux-2.6.0-patch1/drivers/ide/ide-io.c linux-2.6.0/drivers/ide/ide-io.c
--- linux-2.6.0-patch1/drivers/ide/ide-io.c Thu Nov 27 07:45:21 2003
+++ linux-2.6.0/drivers/ide/ide-io.c Wed Jan 28 22:55:00 2004
@@ -843,6 +843,8 @@
drive = choose_drive(hwgroup);
if (drive == NULL) {
unsigned long sleep = 0;
+ hwgroup->busy = ata_pending_commands(hwgroup->drive);
+ if (hwgroup->sleeping) break;
hwgroup->rq = NULL;
drive = hwgroup->drive;
do {
@@ -865,8 +867,6 @@
/* so that ide_timer_expiry knows what to do */
hwgroup->sleeping = 1;
mod_timer(&hwgroup->timer, sleep);
- /* we purposely leave hwgroup->busy==1
- * while sleeping */
} else {
/* Ugly, but how can we sleep for the lock
* otherwise? perhaps from tq_disk?
@@ -874,12 +874,20 @@
/* for atari only */
ide_release_lock();
- hwgroup->busy = 0;
}
/* no more work for this hwgroup (for now) */
return;
}
+
+ if (hwgroup->sleeping) {
+ if (!del_timer(&hwgroup->timer)) {
+ hwgroup->busy = 0;
+ break; /* let the timer handler finish; it will call us again */
+ }
+ hwgroup->sleeping = 0;
+ }
+
hwif = HWIF(drive);
if (hwgroup->hwif->sharing_irq &&
hwif != hwgroup->hwif &&
@@ -1060,7 +1068,6 @@
*/
if (hwgroup->sleeping) {
hwgroup->sleeping = 0;
- hwgroup->busy = 0;
}
} else {
ide_drive_t *drive = hwgroup->drive;
next prev parent reply other threads:[~2004-01-30 3:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-03 4:28 [PATCH] fix issues with loading PCI ide drivers as modules (linux 2.6.0) Davin McCall
2004-01-04 1:56 ` Bartlomiej Zolnierkiewicz
2004-01-04 3:21 ` Davin McCall
2004-01-04 3:52 ` Bartlomiej Zolnierkiewicz
2004-01-04 6:31 ` Davin McCall
2004-01-04 14:47 ` Bartlomiej Zolnierkiewicz
2004-01-05 2:09 ` Davin McCall
2004-01-05 14:16 ` Bartlomiej Zolnierkiewicz
2004-01-06 2:51 ` Davin McCall
2004-01-06 11:13 ` Bartlomiej Zolnierkiewicz
2004-01-06 13:09 ` Davin McCall
2004-01-06 13:45 ` Davin McCall
2004-01-30 3:27 ` [PATCH] various IDE patches/cleanups Davin McCall
2004-01-30 3:30 ` Davin McCall [this message]
2004-01-30 3:33 ` Davin McCall
2004-01-30 3:34 ` Davin McCall
2004-01-30 3:35 ` Davin McCall
2004-02-05 5:21 ` Davin McCall
2004-02-05 6:37 ` Davin McCall
2004-02-03 19:41 ` Bartlomiej Zolnierkiewicz
2004-02-05 3:51 ` Davin McCall
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=20040130143041.1eb70817.davmac@ozonline.com.au \
--to=davmac@ozonline.com.au \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome