as-iosched: fix write batch start point

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>

authored by Aaron Carroll and committed by Jens Axboe 49565124 8896f3c0

+2 -1
+2 -1
block/as-iosched.c
··· 1097 ad->batch_data_dir = REQ_ASYNC; 1098 ad->current_write_count = ad->write_batch_count; 1099 ad->write_batch_idled = 0; 1100 - rq = ad->next_rq[ad->batch_data_dir]; 1101 goto dispatch_request; 1102 } 1103
··· 1097 ad->batch_data_dir = REQ_ASYNC; 1098 ad->current_write_count = ad->write_batch_count; 1099 ad->write_batch_idled = 0; 1100 + rq = rq_entry_fifo(ad->fifo_list[REQ_ASYNC].next); 1101 + ad->last_check_fifo[REQ_ASYNC] = jiffies; 1102 goto dispatch_request; 1103 } 1104