Skip to contentSkip to conversation

cfq-iosched: make nonrot check logic consistent

PATCH Applied Shaohua Li 2 participants 4 messages Dec 3, 2009 – Dec 4, 2009 Block layer

lore
Share & tools
lore

Shaohua Li

author
#0 lore raw

PATCH 1/1 cfq-iosched: make nonrot check logic consistent

Send again, last post seems lost.

cfq_arm_slice_timer() has logic to disable idle window for SSD device. The same thing should be done at cfq_select_queue() too, otherwise we will still see idle window. This makes the nonrot check logic consistent in cfq. Tests in a intel SSD with low_latency knob close, below patch can triple disk thoughput for muti-thread sequential read.

---
 block/cfq-iosched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/cfq-iosched.c +2 -1
Index: linux/block/cfq-iosched.c
===================================================================
@@ -1215,7 +1215,8 @@ static struct cfq_queue *cfq_select_queu
 	 * conditions to happen (or time out) before selecting a new queue.
 	 */
 	if (timer_pending(&cfqd->idle_slice_timer) ||
-	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq))) {
+	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq)
+	    && !(blk_queue_nonrot(cfqd->queue) && cfqd->hw_tag))) {
 		cfqq = NULL;
 		goto keep_queue;
 	}
Applied
#1 lore raw
Quoted 18 lines · Shaohua Li

Send again, last post seems lost.

cfq_arm_slice_timer() has logic to disable idle window for SSD device. The same thing should be done at cfq_select_queue() too, otherwise we will still see idle window. This makes the nonrot check logic consistent in cfq. Tests in a intel SSD with low_latency knob close, below patch can triple disk thoughput for muti-thread sequential read.

---
 block/cfq-iosched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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

block/cfq-iosched.c static struct cfq_queue *cfq_select_queu · line 1222

Quoted 9 lines
block/cfq-iosched.c +2 -1
@@ -1215,7 +1215,8 @@ static struct cfq_queue *cfq_select_queu
 	 * conditions to happen (or time out) before selecting a new queue.
 	 */
 	if (timer_pending(&cfqd->idle_slice_timer) ||
-	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq))) {
+	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq)
+	    && !(blk_queue_nonrot(cfqd->queue) && cfqd->hw_tag))) {
 		cfqq = NULL;
 		goto keep_queue;
 	}

Thanks, applied to 2.6.33 queue.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 14 lines · Jens Axboe
Quoted 13 lines · Shaohua Li

Send again, last post seems lost.

cfq_arm_slice_timer() has logic to disable idle window for SSD device. The same thing should be done at cfq_select_queue() too, otherwise we will still see idle window. This makes the nonrot check logic consistent in cfq. Tests in a intel SSD with low_latency knob close, below patch can triple disk thoughput for muti-thread sequential read.

---
 block/cfq-iosched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 16 lines
Quoted 5 lines

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

block/cfq-iosched.c static struct cfq_queue *cfq_select_queu · line 1222

Quoted 9 lines
block/cfq-iosched.c +2 -1
@@ -1215,7 +1215,8 @@ static struct cfq_queue *cfq_select_queu
 	 * conditions to happen (or time out) before selecting a new queue.
 	 */
 	if (timer_pending(&cfqd->idle_slice_timer) ||
-	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq))) {
+	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq)
+	    && !(blk_queue_nonrot(cfqd->queue) && cfqd->hw_tag))) {
 		cfqq = NULL;
 		goto keep_queue;
 	}

Thanks, applied to 2.6.33 queue.

On second check, we now hide that logic in cfq_should_idle() and as such your patch no longer applies. I suggest you re-test with -next or my for-2.6.33 branch, it has a big number of pending CFQ updates for 2.6.33.

Signature · 1 line
Jens Axboe
author
#3 lore raw
Quoted 32 lines · Jens Axboe
Quoted 14 lines · Jens Axboe
Quoted 13 lines · Shaohua Li

Send again, last post seems lost.

cfq_arm_slice_timer() has logic to disable idle window for SSD device. The same thing should be done at cfq_select_queue() too, otherwise we will still see idle window. This makes the nonrot check logic consistent in cfq. Tests in a intel SSD with low_latency knob close, below patch can triple disk thoughput for muti-thread sequential read.

---
 block/cfq-iosched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 16 lines
Quoted 5 lines

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

block/cfq-iosched.c static struct cfq_queue *cfq_select_queu · line 1222

Quoted 9 lines
block/cfq-iosched.c +2 -1
@@ -1215,7 +1215,8 @@ static struct cfq_queue *cfq_select_queu
 	 * conditions to happen (or time out) before selecting a new queue.
 	 */
 	if (timer_pending(&cfqd->idle_slice_timer) ||
-	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq))) {
+	    (cfqq->dispatched && cfq_cfqq_idle_window(cfqq)
+	    && !(blk_queue_nonrot(cfqd->queue) && cfqd->hw_tag))) {
 		cfqq = NULL;
 		goto keep_queue;
 	}

Thanks, applied to 2.6.33 queue.

Quoted 4 lines

On second check, we now hide that logic in cfq_should_idle() and as such your patch no longer applies. I suggest you re-test with -next or my for-2.6.33 branch, it has a big number of pending CFQ updates for 2.6.33.

-next has the same issue too. Below is updated patch.

cfq_arm_slice_timer() has logic to disable idle window for SSD device. The same thing should be done at cfq_select_queue() too, otherwise we will still see idle window. This makes the nonrot check logic consistent in cfq. Tests in a intel SSD with low_latency knob close, below patch can triple disk thoughput for muti-thread sequential read.

block/cfq-iosched.c +2 -1
index 08b057b..abc5206 100644
@@ -1795,7 +1795,8 @@ static bool cfq_should_idle(struct cfq_data *cfqd, struct cfq_queue *cfqq)
 		return false;
 
 	/* We do for queues that were marked with idle window flag. */
-	if (cfq_cfqq_idle_window(cfqq))
+	if (cfq_cfqq_idle_window(cfqq) &&
+	   !(blk_queue_nonrot(cfqd->queue) && cfqd->hw_tag))
 		return true;
 
 	/*