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>

authored by Divyesh Shah and committed by Jens Axboe 875feb63 7af92f87

+6
+6
block/cfq-iosched.c
··· 3077 3077 return true; 3078 3078 3079 3079 /* 3080 + * Don't allow a non-RT request to preempt an ongoing RT cfqq timeslice. 3081 + */ 3082 + if (cfq_class_rt(cfqq) && !cfq_class_rt(new_cfqq)) 3083 + return false; 3084 + 3085 + /* 3080 3086 * if the new request is sync, but the currently running queue is 3081 3087 * not, let the sync request have priority. 3082 3088 */