diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-21 05:14:27 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-21 05:14:27 -0400 |
commit | 5e84ea3a9c662dc2d7a48703a4468fad954a3b7f (patch) | |
tree | 3fa0fb26a7c8a970213584104cc2498ef46d60a3 /block/blk-core.c | |
parent | 4345caba340f051e10847924fc078ae18ed6695c (diff) |
block: attempt to merge with existing requests on plug flush
One of the disadvantages of on-stack plugging is that we potentially
lose out on merging since all pending IO isn't always visible to
everybody. When we flush the on-stack plugs, right now we don't do
any checks to see if potential merge candidates could be utilized.
Correct this by adding a new insert variant, ELEVATOR_INSERT_SORT_MERGE.
It works just ELEVATOR_INSERT_SORT, but first checks whether we can
merge with an existing request before doing the insertion (if we fail
merging).
This fixes a regression with multiple processes issuing IO that
can be merged.
Thanks to Shaohua Li <shaohua.li@intel.com> for testing and fixing
an accounting bug.
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index e1fcf7a24668..525693237a4a 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2685,7 +2685,7 @@ static void flush_plug_list(struct blk_plug *plug) | |||
2685 | /* | 2685 | /* |
2686 | * rq is already accounted, so use raw insert | 2686 | * rq is already accounted, so use raw insert |
2687 | */ | 2687 | */ |
2688 | __elv_add_request(q, rq, ELEVATOR_INSERT_SORT); | 2688 | __elv_add_request(q, rq, ELEVATOR_INSERT_SORT_MERGE); |
2689 | } | 2689 | } |
2690 | 2690 | ||
2691 | if (q) { | 2691 | if (q) { |