summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorDivyesh Shah <dpshah@google.com>2010-01-06 18:58:20 -0800
committerJens Axboe <jens.axboe@oracle.com>2010-01-11 16:16:18 +0100
commit875feb63b9567442be73efbcc9a8470e376d6423 (patch)
tree554331e9634a5327daa755bb1b3338697866018b /block
parent7af92f8754b87bc78cbfd447d5f4096b25c46682 (diff)
downloadlinux-875feb63b9567442be73efbcc9a8470e376d6423.tar.gz
linux-875feb63b9567442be73efbcc9a8470e376d6423.tar.bz2
linux-875feb63b9567442be73efbcc9a8470e376d6423.zip
cfq-iosched: Respect ioprio_class when preempting
In cfq_should_preempt(), we currently allow some cases where a non-RT request can preempt an ongoing RT cfqq timeslice. This should not happen. Examples include: o A sync_noidle wl type non-RT request pre-empting a sync_noidle wl type cfqq on which we are idling. o Once we have per-cgroup async queues, a non-RT sync request pre-empting a RT async cfqq. Signed-off-by: Divyesh Shah<dpshah@google.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 918c7fd9aeb1..ee130f14d1fc 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -3077,6 +3077,12 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
return true;
/*
+ * Don't allow a non-RT request to preempt an ongoing RT cfqq timeslice.
+ */
+ if (cfq_class_rt(cfqq) && !cfq_class_rt(new_cfqq))
+ return false;
+
+ /*
* if the new request is sync, but the currently running queue is
* not, let the sync request have priority.
*/