Skip to content

Commit

Permalink
cfq-iosched: Respect ioprio_class when preempting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Divyesh Shah authored and Jens Axboe committed Jan 11, 2010
1 parent 7af92f8 commit 875feb6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3076,6 +3076,12 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
if (cfq_class_idle(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.
Expand Down

0 comments on commit 875feb6

Please sign in to comment.