From 4fb9b955f3640a12647d4a0b0235e32412dfca3d Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Sat, 22 Mar 2014 13:45:46 -0400 Subject: [PATCH 4/4] dm thin: use on-stack plugging when submitting bios in process_thin_deferred_bios --- drivers/md/dm-thin.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 9f1363c..1319b04 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -1440,6 +1440,7 @@ static void process_thin_deferred_bios(struct thin_c *tc) unsigned long flags; struct bio *bio; struct bio_list bios; + struct blk_plug plug; if (tc->requeue_mode) { requeue_bio_list(tc, &tc->deferred_bio_list); @@ -1461,6 +1462,7 @@ static void process_thin_deferred_bios(struct thin_c *tc) spin_unlock_irqrestore(&tc->lock, flags); + blk_start_plug(&plug); while ((bio = bio_list_pop(&bios))) { /* * If we've got no free new_mapping structs, and processing @@ -1479,6 +1481,7 @@ static void process_thin_deferred_bios(struct thin_c *tc) else pool->process_bio(tc, bio); } + blk_finish_plug(&plug); } static void process_deferred_bios(struct pool *pool) -- 1.7.1