Commit 69d60eb9 authored by Vivek Goyal's avatar Vivek Goyal Committed by Jens Axboe

blk-throttle: Use blk_plug in throttle dispatch

Use plug in throttle dispatch also as we are dispatching a bunch of
bios in throttle context and some of them might merge.
Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 721a9602
...@@ -770,6 +770,7 @@ static int throtl_dispatch(struct request_queue *q) ...@@ -770,6 +770,7 @@ static int throtl_dispatch(struct request_queue *q)
unsigned int nr_disp = 0; unsigned int nr_disp = 0;
struct bio_list bio_list_on_stack; struct bio_list bio_list_on_stack;
struct bio *bio; struct bio *bio;
struct blk_plug plug;
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
...@@ -798,8 +799,10 @@ static int throtl_dispatch(struct request_queue *q) ...@@ -798,8 +799,10 @@ static int throtl_dispatch(struct request_queue *q)
* immediate dispatch * immediate dispatch
*/ */
if (nr_disp) { if (nr_disp) {
blk_start_plug(&plug);
while((bio = bio_list_pop(&bio_list_on_stack))) while((bio = bio_list_pop(&bio_list_on_stack)))
generic_make_request(bio); generic_make_request(bio);
blk_finish_plug(&plug);
} }
return nr_disp; return nr_disp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment