From 3ce2b697b9dd1bf07ba3c161eeb4264cc1a21aa3 Mon Sep 17 00:00:00 2001 From: Corrado Zoccolo Date: Fri, 20 Nov 2009 14:43:02 +0100 Subject: [PATCH 1/2] cfq-iosched: fix no-idle preemption logic An incoming no-idle queue should preempt the active no-idle queue only if the active queue is idling due to service tree empty. This change should affect only non-NCQ rotational devices, since for those ones we introduce additional, small idles, that shouldn't be preempted. Reported-by: Vivek Goyal Signed-off-by: Corrado Zoccolo --- block/cfq-iosched.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 6925ab9..a8f7a26 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -2401,8 +2401,9 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq, if (cfq_class_idle(cfqq)) return true; - if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD - && new_cfqq->service_tree == cfqq->service_tree) + if (cfqd->serving_type == SYNC_NOIDLE_WORKLOAD && + cfqq_type(new_cfqq) == SYNC_NOIDLE_WORKLOAD && + new_cfqq->service_tree-> count == 1) return true; /* -- 1.6.2.5