Skip to content

Commit

Permalink
blk-throttle: Use blk_plug in throttle dispatch
Browse files Browse the repository at this point in the history
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: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Mar 10, 2011
1 parent 721a960 commit 69d60eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ static int throtl_dispatch(struct request_queue *q)
unsigned int nr_disp = 0;
struct bio_list bio_list_on_stack;
struct bio *bio;
struct blk_plug plug;

spin_lock_irq(q->queue_lock);

Expand Down Expand Up @@ -798,8 +799,10 @@ static int throtl_dispatch(struct request_queue *q)
* immediate dispatch
*/
if (nr_disp) {
blk_start_plug(&plug);
while((bio = bio_list_pop(&bio_list_on_stack)))
generic_make_request(bio);
blk_finish_plug(&plug);
}
return nr_disp;
}
Expand Down

0 comments on commit 69d60eb

Please sign in to comment.