Re: [BK PATCHES] add ata scsi driver

Jens Axboe
2003-05-27T06:41:26Z

On Mon, May 26 2003, Linus Torvalds wrote:
>
> On Mon, 26 May 2003, Jens Axboe wrote:
> >
> > > Think of all the fairness issues we've had in the elevator code, and
> > > realize that the low-level disk probably implements _none_ of those
> > > fairness algorithms.
> >
> > I think it does, to some extent at least.
>
> I doubt they do a very good job of it. I know of bad cases, even with
> "high-end" hardware. Sure, we can hope that it's getting better, but do we
> want to bet on it.

No I agree, it's always nice to handle these cases in software so we
don't have to rely on these things getting fixed.

> > > Hmm.. Where does it keep track of request latency for requests that have
> > > been removed from the queue?
> >
> > Well, it doesn't...
>
> Yeah. Which means that right now _really_ long starvation will show up as
> timeouts, while other cases will just show up as bad latency.
>
> Which will _work_, of course (assuming the timeout handling is correct,
> which is a big if in itself), but it still sucks from a usability
> standpoint.
>
> Even if we drop our timeouts from 30 seconds (or whatever they are now)
> down to just a few seconds, that's a _loooong_ time, and we should be a
> lot more proactive about things. Audio/video stuff tends to want things
> with latencies in the tenth-of-a-second range, even when they buffer
> things up internally to hide the worst cases.

Here's something ridicolously simple, that just wont start a new tag if
the oldest tag is older than 100ms. Clearly nothing for submission, but
it gets the point across.

Now only look at reads, and we've got something a little useful at
least.

James, speaking of queue localities and tcq... Doug mentioned some time
ago that aic7xxx dishes out tags numbers from a hba pool which makes it
impossible to support with out current block layer queueing code. Maybe
it we associate the blk_queue_tag structure with a bunch of queues
instead of having a 1:1 mapping it could work.

===== drivers/block/ll_rw_blk.c 1.170 vs edited =====
--- 1.170/drivers/block/ll_rw_blk.c Thu May 8 11:30:11 2003
+++ edited/drivers/block/ll_rw_blk.c Tue May 27 08:44:44 2003
@@ -574,6 +574,13 @@
BUG();
}

+ if (!list_empty(&bqt->busy_list)) {
+ struct request *__rq = list_entry_rq(bqt->busy_list.prev);
+
+ if (time_after(rq->timeout, jiffies))
+ return 1;
+ }
+
for (map = bqt->tag_map; *map == -1UL; map++) {
tag += BLK_TAGS_PER_LONG;

@@ -589,6 +596,7 @@
bqt->tag_index[tag] = rq;
blkdev_dequeue_request(rq);
list_add(&rq->queuelist, &bqt->busy_list);
+ rq->timeout = jiffies + HZ / 10;
bqt->busy++;
return 0;
}

--
Jens Axboe