public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* block CFQ: avoid moving request to different queue
@ 2012-11-06 11:34 Shaohua Li
  2012-11-06 11:39 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Shaohua Li @ 2012-11-06 11:34 UTC (permalink / raw)
  To: axboe; +Cc: linux-kernel

request is queued in cfqq->fifo list. Looks it's possible we are moving a
request from one cfqq to another in request merge case. In such case, adjusting
the fifo list order doesn't make sense and is impossible if we don't iterate
the whole fifo list.

My test does hit one case the two cfqq are different, but didn't cause kernel
crash, maybe it's because fifo list isn't used frequently. Anyway, from the
code logic, this is buggy.

I thought we can re-enable the recusive merge logic after this is fixed.

Signed-off-by: Shaohua Li <shli@fusionio.com>
---
 block/cfq-iosched.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux/block/cfq-iosched.c
===================================================================
--- linux.orig/block/cfq-iosched.c	2012-08-29 16:18:35.339907814 +0800
+++ linux/block/cfq-iosched.c	2012-11-06 19:26:05.575446275 +0800
@@ -1973,7 +1973,8 @@ cfq_merged_requests(struct request_queue
 	 * reposition in fifo if next is older than rq
 	 */
 	if (!list_empty(&rq->queuelist) && !list_empty(&next->queuelist) &&
-	    time_before(rq_fifo_time(next), rq_fifo_time(rq))) {
+	    time_before(rq_fifo_time(next), rq_fifo_time(rq)) &&
+	    cfqq == RQ_CFQQ(next)) {
 		list_move(&rq->queuelist, &next->queuelist);
 		rq_set_fifo_time(rq, rq_fifo_time(next));
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-07  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-06 11:34 block CFQ: avoid moving request to different queue Shaohua Li
2012-11-06 11:39 ` Jens Axboe
2012-11-07  1:05   ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox