Re: 2.6.20-rc2+: CFQ halving disk throughput.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jens Axboe
Date: Tuesday, January 2, 2007 - 5:10 am

On Tue, Jan 02 2007, Jens Axboe wrote:

And here a little more relaxed version, as Mark Lord suggested. We allow
merge of async bio into a sync request, but not vice versa.

Both patches pending testing, will do so now.

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 4b4217d..07b7062 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -577,9 +577,9 @@ static int cfq_allow_merge(request_queue
 	pid_t key;
 
 	/*
-	 * Disallow merge, if bio and rq aren't both sync or async
+	 * Disallow merge of a sync bio into an async request.
 	 */
-	if (!!bio_sync(bio) != !!rq_is_sync(rq))
+	if ((bio_data_dir(bio) == READ || bio_sync(bio)) && !rq_is_sync(rq))
 		return 0;
 
 	/*
@@ -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

-- 
Jens Axboe

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.20-rc2+: CFQ halving disk throughput., Rene Herman, (Mon Jan 1, 3:46 pm)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Rene Herman, (Mon Jan 1, 3:56 pm)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Mark Lord, (Mon Jan 1, 4:28 pm)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Linus Torvalds, (Mon Jan 1, 4:30 pm)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Andrew Morton, (Mon Jan 1, 10:36 pm)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Jens Axboe, (Tue Jan 2, 1:34 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Jens Axboe, (Tue Jan 2, 1:44 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Rene Herman, (Tue Jan 2, 3:24 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Jens Axboe, (Tue Jan 2, 4:57 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Jens Axboe, (Tue Jan 2, 5:10 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Mark Lord, (Tue Jan 2, 8:01 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Mark Lord, (Tue Jan 2, 8:12 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Jens Axboe, (Tue Jan 2, 8:14 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Mark Lord, (Tue Jan 2, 8:40 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Jens Axboe, (Tue Jan 2, 8:45 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Tejun Heo, (Tue Jan 2, 9:53 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Jan Engelhardt, (Tue Jan 2, 10:09 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Mark Lord, (Tue Jan 2, 10:35 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Tejun Heo, (Tue Jan 2, 10:53 am)
Re: 2.6.20-rc2+: CFQ halving disk throughput., Mark Lord, (Tue Jan 2, 11:10 am)