]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - block/cfq-iosched.c
block cfq: make queue preempt work for queues from different workload
[mv-sheeva.git] / block / cfq-iosched.c
index 8427697c5437c2961633d1a7b7c10465a96f1fa2..7bfea53c1bb54c1c6b5fb3273b61760205a2dba2 100644 (file)
@@ -3284,9 +3284,18 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
  */
 static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
 {
+       struct cfq_queue *old_cfqq = cfqd->active_queue;
+
        cfq_log_cfqq(cfqd, cfqq, "preempt");
        cfq_slice_expired(cfqd, 1);
 
+       /*
+        * workload type is changed, don't save slice, otherwise preempt
+        * doesn't happen
+        */
+       if (cfqq_type(old_cfqq) != cfqq_type(cfqq))
+               cfqq->cfqg->saved_workload_slice = 0;
+
        /*
         * Put the new queue at the front of the of the current list,
         * so we know that it will be selected next.