aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-01-02 12:32:11 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-02 12:46:16 -0500
commitec8acb6904fabb8e741f741ec99bb1c18f2b3dee (patch)
tree9d4da59b2ccc4b1424b90497c7b26778c272ca5a /block
parentdc3c3377f03634d351fafdfe35b237b283586c04 (diff)
[PATCH] cfq-iosched: merging problem
Two issues: - The final return 1 should be a return 0, otherwise comparing cfqq is a noop. - bio_sync() only checks the sync flag, while rq_is_sync() checks both for READ and sync. The latter is what we want. Expand the bio check to include reads, and relax the restriction to allow merging of async io into sync requests. In the future we want to clean up the SYNC logic, right now it means both sync request (such as READ and O_DIRECT WRITE) and unplug-on-issue. Leave that for later. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 4b4217d9be78..07b706243772 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -577,9 +577,9 @@ static int cfq_allow_merge(request_queue_t *q, struct request *rq,
577 pid_t key; 577 pid_t key;
578 578
579 /* 579 /*
580 * Disallow merge, if bio and rq aren't both sync or async 580 * Disallow merge of a sync bio into an async request.
581 */ 581 */
582 if (!!bio_sync(bio) != !!rq_is_sync(rq)) 582 if ((bio_data_dir(bio) == READ || bio_sync(bio)) && !rq_is_sync(rq))
583 return 0; 583 return 0;
584 584
585 /* 585 /*
@@ -592,7 +592,7 @@ static int cfq_allow_merge(request_queue_t *q, struct request *rq,
592 if (cfqq == RQ_CFQQ(rq)) 592 if (cfqq == RQ_CFQQ(rq))
593 return 1; 593 return 1;
594 594
595 return 1; 595 return 0;
596} 596}
597 597
598static inline void 598static inline void