mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Jens Axboe <jaxboe@fusionio.com>,
	"czoccolo@gmail.com" <czoccolo@gmail.com>
Subject: Re: [patch]block cfq: select new workload if priority changed
Date: Mon, 13 Dec 2010 08:39:52 +0800	[thread overview]
Message-ID: <1292200792.2323.13.camel@sli10-conroe> (raw)
In-Reply-To: <x49sjy5ad81.fsf@segfault.boston.devel.redhat.com>

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




  reply	other threads:[~2010-12-13  0:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  5:17 Shaohua Li
2010-12-10 14:56 ` Jeff Moyer
2010-12-13  0:39   ` Shaohua Li [this message]
2010-12-13 13:32     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292200792.2323.13.camel@sli10-conroe \
    --to=shaohua.li@intel.com \
    --cc=czoccolo@gmail.com \
    --cc=jaxboe@fusionio.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome