public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfq-iosched: Respect ioprio_class when preempting
@ 2010-01-07  2:58 Divyesh Shah
  2010-01-11 15:15 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Divyesh Shah @ 2010-01-07  2:58 UTC (permalink / raw)
  To: jens.axboe, czoccolo, linux-kernel; +Cc: nauman, mikew, ctalbott

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>
---

 block/cfq-iosched.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 7d6cef9..e9e6610 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -3104,6 +3104,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.
 	 */


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cfq-iosched: Respect ioprio_class when preempting
  2010-01-07  2:58 [PATCH] cfq-iosched: Respect ioprio_class when preempting Divyesh Shah
@ 2010-01-11 15:15 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2010-01-11 15:15 UTC (permalink / raw)
  To: Divyesh Shah; +Cc: czoccolo, linux-kernel, nauman, mikew, ctalbott

On Wed, Jan 06 2010, Divyesh Shah wrote:
> 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>
> ---
> 
>  block/cfq-iosched.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
> index 7d6cef9..e9e6610 100644
> --- a/block/cfq-iosched.c
> +++ b/block/cfq-iosched.c
> @@ -3104,6 +3104,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;

It would be nice to just be able to do

        if (new_cfqq->ioprio_class > cfqq->ioprio_class)
                return false;

but that doesn't quite work given IOPRIO_CLASS_NONE < _RT. So I think
your patch is fine, I've added it. Thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-11 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-07  2:58 [PATCH] cfq-iosched: Respect ioprio_class when preempting Divyesh Shah
2010-01-11 15:15 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox