mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Jens Axboe <jaxboe@fusionio.com>, czoccolo@gmail.com
Subject: [patch]block cfq: select new workload if priority changed
Date: Thu, 09 Dec 2010 13:17:33 +0800	[thread overview]
Message-ID: <1291871853.2323.8.camel@sli10-conroe> (raw)

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



             reply	other threads:[~2010-12-09  5:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  5:17 Shaohua Li [this message]
2010-12-10 14:56 ` Jeff Moyer
2010-12-13  0:39   ` Shaohua Li
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=1291871853.2323.8.camel@sli10-conroe \
    --to=shaohua.li@intel.com \
    --cc=czoccolo@gmail.com \
    --cc=jaxboe@fusionio.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

all inboxes | Powered by JetHome®