Re: [PATCH] various IDE patches/cleanups

From: Davin McCall
Date: Thu Jan 29 2004 - 22:34:01 EST


4th patch notes
---------------

choose_drive() selects which drive in a hwgroup will have a request serviced.
It tries not to return a drive whose queue is plugged, but there's a small
mistake which means it might do this sometimes.

Once we've guarenteed that the returned drive is never plugged, it's possible
to remove a check in ide_do_request() (or actually, modify it, seeing as the
drive can still get plugged between requests in the tcq case).

- (ide-io.c)
- ide_do_request()
- Move check of blk_queue_plugged() just after the check for the service
routine returning ide_released. So we only check it between tcq
requests.
- choose_drive()
- A plugged drive can't benefit from "nice" behaviour. Neither can
a drive with no requests in its queue.

--- linux-2.6.0-patch3/drivers/ide/ide-io.c Thu Jan 29 12:43:26 2004
+++ linux-2.6.0/drivers/ide/ide-io.c Thu Jan 29 12:48:09 2004
@@ -776,7 +776,9 @@
if (!drive->sleep
/* FIXME: use time_before */
&& 0 < (signed long)(WAKEUP(drive) - (jiffies - best->service_time))
- && 0 < (signed long)((jiffies + t) - WAKEUP(drive)))
+ && 0 < (signed long)((jiffies + t) - WAKEUP(drive))
+ && !blk_queue_plugged(drive->queue)
+ && !elv_queue_empty(drive->queue))
{
ide_stall_queue(best, IDE_MIN(t, 10 * WAIT_MIN_SLEEP));
goto repeat;
@@ -908,14 +910,6 @@
break;
}

- if (blk_queue_plugged(drive->queue)) {
- if (drive->using_tcq)
- break;
-
- printk(KERN_ERR "ide: huh? queue was plugged!\n");
- break;
- }
-
/*
* we know that the queue isn't empty, but this can happen
* if the q->prep_rq_fn() decides to kill a request
@@ -967,8 +961,11 @@
spin_lock_irq(&ide_lock);
if (hwif->irq != masked_irq)
enable_irq(hwif->irq);
- if (startstop == ide_released)
+ if (startstop == ide_released) {
+ if (blk_queue_plugged(drive->queue))
+ break;
goto queue_next;
+ }
if (startstop == ide_stopped)
hwgroup->busy = 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/