Commit:     ec8acb6904fabb8e741f741ec99bb1c18f2b3dee
Parent:     dc3c3377f03634d351fafdfe35b237b283586c04
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 2 18:32:11 2007 +0100
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jan 2 09:46:16 2007 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 block/cfq-iosched.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

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_t *q, struct 
request *rq,
        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_t *q, struct 
request *rq,
        if (cfqq == RQ_CFQQ(rq))
                return 1;
-       return 1;
+       return 0;
 static inline void
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to