Skip to contentSkip to conversation

CFQ: clear wait_request flag if needed

PATCH In review Gui Jianfeng 2 participants 2 messages Aug 21, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CFQ: clear wait_request flag if needed

Hi Jens,

IMHO wait_request flag should be cleared if a request goes in and idle timer needs to shut down. Otherwise, it will walk into that path every time when a request is enqueued.

---
 block/cfq-iosched.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
block/cfq-iosched.c +1 -0
index fd7080e..67f1910 100644
@@ -2093,6 +2093,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
 			if (blk_rq_bytes(rq) > PAGE_CACHE_SIZE ||
 			    cfqd->busy_queues > 1) {
 				del_timer(&cfqd->idle_slice_timer);
+				cfq_clear_cfqq_wait_request(cfqq);
 			__blk_run_queue(cfqd->queue);
 			}
 			cfq_mark_cfqq_must_dispatch(cfqq);
Signature · 1 line
1.5.4.rc3
#1 lore raw
Quoted 5 lines · Gui Jianfeng

Hi Jens,

IMHO wait_request flag should be cleared if a request goes in and idle timer needs to shut down. Otherwise, it will walk into that path every time when a request is enqueued.

That looks correct, deletion of the timer should always be paired with the clearing of that flag. Applied, thanks!

Quoted 21 lines
---
 block/cfq-iosched.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
block/cfq-iosched.c +1 -0
index fd7080e..67f1910 100644
@@ -2093,6 +2093,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
 			if (blk_rq_bytes(rq) > PAGE_CACHE_SIZE ||
 			    cfqd->busy_queues > 1) {
 				del_timer(&cfqd->idle_slice_timer);
+				cfq_clear_cfqq_wait_request(cfqq);
 			__blk_run_queue(cfqd->queue);
 			}
 			cfq_mark_cfqq_must_dispatch(cfqq);
Signature · 1 line
1.5.4.rc3
Signature · 1 line
Jens Axboe