mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Corrado Zoccolo <czoccolo@gmail.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
	Jeff Moyer <jmoyer@redhat.com>, Vivek Goyal <vgoyal@redhat.com>,
	Shaohua Li <shaohua.li@intel.com>,
	Gui Jianfeng <guijianfeng@cn.fujitsu.com>,
	Corrado Zoccolo <czoccolo@gmail.com>
Subject: [PATCH] cfq-iosched: replace sync_flight by rq_in_driver[BLK_RW_SYNC]
Date: Wed, 30 Dec 2009 16:08:58 +0100	[thread overview]
Message-ID: <1262185738-11942-1-git-send-email-czoccolo@gmail.com> (raw)

According to my intuition (and brief testing), sync_flight is always
equal to rq_in_driver[BLK_RW_SYNC] at the point of usage, so it can
be removed and replaced by the other.

Signed-off-by: Corrado Zoccolo <czoccolo@gmail.com>
---
 block/cfq-iosched.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 01bb0f3..4865e08 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -228,7 +228,6 @@ struct cfq_data {
 	unsigned int busy_queues;
 
 	int rq_in_driver[2];
-	int sync_flight;
 
 	/*
 	 * queue-depth detection
@@ -1875,8 +1874,6 @@ static void cfq_dispatch_insert(struct request_queue *q, struct request *rq)
 	cfqq->dispatched++;
 	elv_dispatch_sort(q, rq);
 
-	if (cfq_cfqq_sync(cfqq))
-		cfqd->sync_flight++;
 	cfqq->nr_sectors += blk_rq_sectors(rq);
 }
 
@@ -2229,7 +2226,7 @@ static bool cfq_may_dispatch(struct cfq_data *cfqd, struct cfq_queue *cfqq)
 	/*
 	 * If this is an async queue and we have sync IO in flight, let it wait
 	 */
-	if (cfqd->sync_flight && !cfq_cfqq_sync(cfqq))
+	if (cfqd->rq_in_driver[BLK_RW_SYNC] && !cfq_cfqq_sync(cfqq))
 		return false;
 
 	max_dispatch = cfqd->cfq_quantum;
@@ -3294,9 +3291,6 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
 	cfqd->rq_in_driver[sync]--;
 	cfqq->dispatched--;
 
-	if (cfq_cfqq_sync(cfqq))
-		cfqd->sync_flight--;
-
 	if (sync) {
 		RQ_CIC(rq)->last_end_request = now;
 		if (!time_after(rq->start_time + cfqd->cfq_fifo_expire[1], now))
-- 
1.6.4.4


             reply	other threads:[~2009-12-30 15:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30 15:08 Corrado Zoccolo [this message]
2009-12-30 18:47 ` Jens Axboe
2009-12-30 20:50   ` Corrado Zoccolo
2009-12-30 21:16     ` Jens Axboe
2009-12-30 22:24       ` [PATCH] cfq-iosched: requests "in flight" vs "in driver" clarification Corrado Zoccolo

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=1262185738-11942-1-git-send-email-czoccolo@gmail.com \
    --to=czoccolo@gmail.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=jens.axboe@oracle.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shaohua.li@intel.com \
    --cc=vgoyal@redhat.com \
    /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®