Skip to contentSkip to conversation

as-iosched: fix write batch start point

PATCH In review Aaron Carroll 3 participants 3 messages Dec 5, 2007 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 block/as-iosched.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
block/as-iosched.c +2 -1
index 4513fc5..555cd6b 100644
@@ -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;
 	}
 
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Aaron Carroll

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.

I think this seems reasonable. What's deadline doing in this case? They should probably be kept in synch where possible...

Quoted 19 lines
---
 block/as-iosched.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
block/as-iosched.c +2 -1
index 4513fc5..555cd6b 100644
@@ -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;
 	}
 
#2 lore raw
Quoted 11 lines · Nick Piggin
Quoted 7 lines · Aaron Carroll

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.

I think this seems reasonable. What's deadline doing in this case? They should probably be kept in synch where possible...

Aaron sent a similar patch for deadline a while ago, so this just matches them up again. I acked that patch, it makes a lot of sense to me.

Signature · 1 line
Jens Axboe