aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-04-06 08:48:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-06 11:04:54 -0400
commitaeb6fafb8fa53266d70ca7474fcda2bdaf96524a (patch)
treeebe8e0c616a9dbfdfe5184b64d0150ea02d3d1b2 /block/cfq-iosched.c
parent644b2d99b7a8677a56909a7b1fde31677eba4471 (diff)
block: Add flag for telling the IO schedulers NOT to anticipate more IO
By default, CFQ will anticipate more IO from a given io context if the previously completed IO was sync. This used to be fine, since the only sync IO was reads and O_DIRECT writes. But with more "normal" sync writes being used now, we don't want to anticipate for those. Add a bio/request flag that informs the IO scheduler that this is a sync request that we should not idle for. Introduce WRITE_ODIRECT specifically for O_DIRECT writes, and make sure that the other sync writes set this flag. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 664ebfd092ec..9e809345f71a 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1992,8 +1992,10 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
1992 } 1992 }
1993 if (cfq_slice_used(cfqq) || cfq_class_idle(cfqq)) 1993 if (cfq_slice_used(cfqq) || cfq_class_idle(cfqq))
1994 cfq_slice_expired(cfqd, 1); 1994 cfq_slice_expired(cfqd, 1);
1995 else if (sync && RB_EMPTY_ROOT(&cfqq->sort_list)) 1995 else if (sync && !rq_noidle(rq) &&
1996 RB_EMPTY_ROOT(&cfqq->sort_list)) {
1996 cfq_arm_slice_timer(cfqd); 1997 cfq_arm_slice_timer(cfqd);
1998 }
1997 } 1999 }
1998 2000
1999 if (!cfqd->rq_in_driver) 2001 if (!cfqd->rq_in_driver)