All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch]block cfq: select new workload if priority changed
@ 2010-12-09  5:17 Shaohua Li
  2010-12-10 14:56 ` Jeff Moyer
  0 siblings, 1 reply; 4+ messages in thread
From: Shaohua Li @ 2010-12-09  5:17 UTC (permalink / raw)
  To: lkml; +Cc: Jens Axboe, czoccolo

If priority is changed, continue checking workload_expires and service tree
count of previous workload is meaningless. We should always choose the workload
with lowest key of new priority in such case.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
---
 block/cfq-iosched.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux/block/cfq-iosched.c
===================================================================
--- linux.orig/block/cfq-iosched.c	2010-12-08 19:39:01.000000000 +0800
+++ linux/block/cfq-iosched.c	2010-12-09 10:27:24.000000000 +0800
@@ -2116,6 +2116,7 @@ static void choose_service_tree(struct c
 	unsigned count;
 	struct cfq_rb_root *st;
 	unsigned group_slice;
+	enum wl_prio_t original_prio = cfqd->serving_prio;
 
 	if (!cfqg) {
 		cfqd->serving_prio = IDLE_WORKLOAD;
@@ -2134,6 +2135,9 @@ static void choose_service_tree(struct c
 		return;
 	}
 
+	if (original_prio != cfqd->serving_prio)
+		goto new_workload;
+
 	/*
 	 * For RT and BE, we have to choose also the type
 	 * (SYNC, SYNC_NOIDLE, ASYNC), and to compute a workload
@@ -2148,6 +2152,7 @@ static void choose_service_tree(struct c
 	if (count && !time_after(jiffies, cfqd->workload_expires))
 		return;
 
+new_workload:
 	/* otherwise select new workload type */
 	cfqd->serving_type =
 		cfq_choose_wl(cfqd, cfqg, cfqd->serving_prio);



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

* Re: [patch]block cfq: select new workload if priority changed
  2010-12-09  5:17 [patch]block cfq: select new workload if priority changed Shaohua Li
@ 2010-12-10 14:56 ` Jeff Moyer
  2010-12-13  0:39   ` Shaohua Li
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Moyer @ 2010-12-10 14:56 UTC (permalink / raw)
  To: Shaohua Li; +Cc: lkml, Jens Axboe, czoccolo

Shaohua Li <shaohua.li@intel.com> writes:

> If priority is changed, continue checking workload_expires and service tree
> count of previous workload is meaningless. We should always choose the workload

I'd change that first sentence to:

  If priority is changed, continuing to check workload_expires and
  service tree count of the previous workload does not make sense.

> with lowest key of new priority in such case.
>
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>

This makes sense to me.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

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

* Re: [patch]block cfq: select new workload if priority changed
  2010-12-10 14:56 ` Jeff Moyer
@ 2010-12-13  0:39   ` Shaohua Li
  2010-12-13 13:32     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Shaohua Li @ 2010-12-13  0:39 UTC (permalink / raw)
  To: Jeff Moyer; +Cc: lkml, Jens Axboe, czoccolo

On Fri, 2010-12-10 at 22:56 +0800, Jeff Moyer wrote:
> Shaohua Li <shaohua.li@intel.com> writes:
> 
> > If priority is changed, continue checking workload_expires and service tree
> > count of previous workload is meaningless. We should always choose the workload
> 
> I'd change that first sentence to:
> 
>   If priority is changed, continuing to check workload_expires and
>   service tree count of the previous workload does not make sense.
> 
> > with lowest key of new priority in such case.
> >
> > Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> 
> This makes sense to me.
> 
> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Thanks, modified the the changelog.




If priority is changed, continuing to check workload_expires and service tree
count of the previous workload does not make sense. We should always choose
the workload with lowest key of new priority in such case.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
---
 block/cfq-iosched.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux/block/cfq-iosched.c
===================================================================
--- linux.orig/block/cfq-iosched.c	2010-12-08 19:39:01.000000000 +0800
+++ linux/block/cfq-iosched.c	2010-12-09 10:27:24.000000000 +0800
@@ -2116,6 +2116,7 @@ static void choose_service_tree(struct c
 	unsigned count;
 	struct cfq_rb_root *st;
 	unsigned group_slice;
+	enum wl_prio_t original_prio = cfqd->serving_prio;
 
 	if (!cfqg) {
 		cfqd->serving_prio = IDLE_WORKLOAD;
@@ -2134,6 +2135,9 @@ static void choose_service_tree(struct c
 		return;
 	}
 
+	if (original_prio != cfqd->serving_prio)
+		goto new_workload;
+
 	/*
 	 * For RT and BE, we have to choose also the type
 	 * (SYNC, SYNC_NOIDLE, ASYNC), and to compute a workload
@@ -2148,6 +2152,7 @@ static void choose_service_tree(struct c
 	if (count && !time_after(jiffies, cfqd->workload_expires))
 		return;
 
+new_workload:
 	/* otherwise select new workload type */
 	cfqd->serving_type =
 		cfq_choose_wl(cfqd, cfqg, cfqd->serving_prio);




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

* Re: [patch]block cfq: select new workload if priority changed
  2010-12-13  0:39   ` Shaohua Li
@ 2010-12-13 13:32     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2010-12-13 13:32 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Jeff Moyer, lkml, czoccolo

On 2010-12-13 01:39, Shaohua Li wrote:
> On Fri, 2010-12-10 at 22:56 +0800, Jeff Moyer wrote:
>> Shaohua Li <shaohua.li@intel.com> writes:
>>
>>> If priority is changed, continue checking workload_expires and service tree
>>> count of previous workload is meaningless. We should always choose the workload
>>
>> I'd change that first sentence to:
>>
>>   If priority is changed, continuing to check workload_expires and
>>   service tree count of the previous workload does not make sense.
>>
>>> with lowest key of new priority in such case.
>>>
>>> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
>>
>> This makes sense to me.
>>
>> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
> Thanks, modified the the changelog.

Thanks, applied to for-2.6.38/core

-- 
Jens Axboe


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

end of thread, other threads:[~2010-12-13 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-09  5:17 [patch]block cfq: select new workload if priority changed Shaohua Li
2010-12-10 14:56 ` Jeff Moyer
2010-12-13  0:39   ` Shaohua Li
2010-12-13 13:32     ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.