Skip to contentSkip to conversation

cfq-iosched: removing unnecessary think time checking

PATCH In review Shaohua Li 2 participants 2 messages Mar 15, 2011 Block layer

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 cfq-iosched: removing unnecessary think time checking

Removing think time checking. A high thinktime queue might means the queue dispatches several requests and then do away. Limitting such queue seems meaningless. And also this can simplify code. This is suggested by Vivek.

---
 block/cfq-iosched.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
block/cfq-iosched.c +4 -9
Index: linux/block/cfq-iosched.c
===================================================================
@@ -2418,19 +2418,14 @@ static bool cfq_may_dispatch(struct cfq_
 			return false;
 
 		/*
-		 * If there is only one sync queue, and its think time is
-		 * small, we can ignore async queue here and give the sync
+		 * If there is only one sync queue
+		 * we can ignore async queue here and give the sync
 		 * queue no dispatch limit. The reason is a sync queue can
 		 * preempt async queue, limiting the sync queue doesn't make
 		 * sense. This is useful for aiostress test.
 		 */
-		if (cfq_cfqq_sync(cfqq) && cfqd->busy_sync_queues == 1) {
-			struct cfq_io_context *cic = RQ_CIC(cfqq->next_rq);
-
-			if (sample_valid(cic->ttime_samples) &&
-				cic->ttime_mean < cfqd->cfq_slice_idle)
-				promote_sync = true;
-		}
+		if (cfq_cfqq_sync(cfqq) && cfqd->busy_sync_queues == 1)
+			promote_sync = true;
 
 		/*
 		 * We have other queues, don't allow more IO from this one
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Shaohua Li

Removing think time checking. A high thinktime queue might means the queue dispatches several requests and then do away. Limitting such queue seems meaningless. And also this can simplify code. This is suggested by Vivek.

Looks good to me.

I really can't find a relation between why should we allow unlimited dispatch only for low thinktime queues and not for high thinktime queue.

concern here is that due to preemtion it can happen that async IO is starved. I think high think time queue automatically mitigates that up to some extent that there will be time interval when async IO will get time to dispatch.

If we run into issues of sync starving async, then it should probably controlled by not giving unlimited queue depth to sync but by limiting it to some higher number.

Thanks
Vivek

Quoted 33 lines
---
 block/cfq-iosched.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Index: linux/block/cfq-iosched.c
===================================================================

block/cfq-iosched.c +4 -9
@@ -2418,19 +2418,14 @@ static bool cfq_may_dispatch(struct cfq_
 			return false;
 
 		/*
-		 * If there is only one sync queue, and its think time is
-		 * small, we can ignore async queue here and give the sync
+		 * If there is only one sync queue
+		 * we can ignore async queue here and give the sync
 		 * queue no dispatch limit. The reason is a sync queue can
 		 * preempt async queue, limiting the sync queue doesn't make
 		 * sense. This is useful for aiostress test.
 		 */
-		if (cfq_cfqq_sync(cfqq) && cfqd->busy_sync_queues == 1) {
-			struct cfq_io_context *cic = RQ_CIC(cfqq->next_rq);
-
-			if (sample_valid(cic->ttime_samples) &&
-				cic->ttime_mean < cfqd->cfq_slice_idle)
-				promote_sync = true;
-		}
+		if (cfq_cfqq_sync(cfqq) && cfqd->busy_sync_queues == 1)
+			promote_sync = true;
 
 		/*
 		 * We have other queues, don't allow more IO from this one