public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Rene Herman <rene.herman@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>, Tejun Heo <htejun@gmail.com>,
	Jens Axboe <axboe@suse.de>, Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>
Subject: Re: 2.6.20-rc2+: CFQ halving disk throughput.
Date: Tue, 2 Jan 2007 12:57:57 +0100	[thread overview]
Message-ID: <20070102115757.GT2483@kernel.dk> (raw)
In-Reply-To: <459A32E5.70506@gmail.com>

On Tue, Jan 02 2007, Rene Herman wrote:
> Jens Axboe wrote:
> 
> >On Mon, Jan 01 2007, Andrew Morton wrote:
> 
> >>The patch would appear to need this fix:
> >>
> >>--- a/block/cfq-iosched.c~a
> >>+++ a/block/cfq-iosched.c
> >>@@ -592,7 +592,7 @@ static int cfq_allow_merge(request_queue
> >> 	if (cfqq == RQ_CFQQ(rq))
> >> 		return 1;
> >> 
> >>-	return 1;
> >>+	return 0;
> >> }
> >> 
> >> static inline void
> >>_
> >>
> >>But that might not fix things...
> >
> >Yeah it is, but I don't think it'll fix it (if anything, it'll be more
> >conservative).
> 
> (to possibly save others from trying -- no, doesn't fix any)

As expected. The issue is rq_is_sync(rq) takes the data direction into
account as well, while bio_sync() only checks the sync bit. This should
fix it.

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 4b4217d..26fb40f 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -574,12 +574,14 @@ static int cfq_allow_merge(request_queue
 	struct cfq_data *cfqd = q->elevator->elevator_data;
 	const int rw = bio_data_dir(bio);
 	struct cfq_queue *cfqq;
+	int bio_is_sync;
 	pid_t key;
 
 	/*
 	 * Disallow merge, if bio and rq aren't both sync or async
 	 */
-	if (!!bio_sync(bio) != !!rq_is_sync(rq))
+	bio_is_sync = bio_data_dir(bio) == READ || bio_sync(bio);
+	if (bio_is_sync != !!rq_is_sync(rq))
 		return 0;
 
 	/*
@@ -592,7 +594,7 @@ static int cfq_allow_merge(request_queue
 	if (cfqq == RQ_CFQQ(rq))
 		return 1;
 
-	return 1;
+	return 0;
 }
 

-- 
Jens Axboe


  reply	other threads:[~2007-01-02 11:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 13:37 PATA -- pata_amd on 2.6.19 fails to IDENTIFY my DVD-ROM Rene Herman
2006-12-27  7:19 ` Tejun Heo
2006-12-27 17:50   ` Rene Herman
2006-12-28  2:24     ` Tejun Heo
2007-01-01 22:46       ` 2.6.20-rc2+: CFQ halving disk throughput Rene Herman
2007-01-01 22:56         ` Rene Herman
2007-01-01 23:30           ` Linus Torvalds
2007-01-01 23:28         ` Mark Lord
2007-01-02  8:34           ` Jens Axboe
2007-01-02 15:01             ` Mark Lord
2007-01-02 16:53               ` Tejun Heo
2007-01-02 17:35                 ` Mark Lord
2007-01-02 17:53                   ` Tejun Heo
2007-01-02 18:10                     ` Mark Lord
2007-01-02 17:09               ` Jan Engelhardt
2007-01-02  5:36         ` Andrew Morton
2007-01-02  8:44           ` Jens Axboe
2007-01-02 10:24             ` Rene Herman
2007-01-02 11:57               ` Jens Axboe [this message]
2007-01-02 12:10                 ` Jens Axboe
2007-01-02 15:12                   ` Mark Lord
2007-01-02 15:14                     ` Jens Axboe
2007-01-02 15:40                       ` Mark Lord
2007-01-02 15:45                         ` 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=20070102115757.GT2483@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=axboe@suse.de \
    --cc=htejun@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rene.herman@gmail.com \
    --cc=torvalds@osdl.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