as-iosched: fix write batch start point
authorAaron Carroll <aaronc@gelato.unsw.edu.au>
Wed, 5 Dec 2007 10:07:07 +0000 (21:07 +1100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 18 Dec 2007 07:29:28 +0000 (08:29 +0100)
New write batches currently start from where the last one completed.
We have no idea where the head is after switching batches, so this
makes little sense.  Instead, start the next batch from the request
with the earliest deadline in the hope that we avoid a deadline
expiry later on.

Signed-off-by: Aaron Carroll <aaronc@gelato.unsw.edu.au>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/as-iosched.c

index 4513fc59c9da5503c5cde98b3e7de1bb97633f8a..555cd6bf4ce51b7044d8bdc86b35573684b0da8d 100644 (file)
@@ -1097,7 +1097,8 @@ dispatch_writes:
                ad->batch_data_dir = REQ_ASYNC;
                ad->current_write_count = ad->write_batch_count;
                ad->write_batch_idled = 0;
-               rq = ad->next_rq[ad->batch_data_dir];
+               rq = rq_entry_fifo(ad->fifo_list[REQ_ASYNC].next);
+               ad->last_check_fifo[REQ_ASYNC] = jiffies;
                goto dispatch_request;
        }