Skip to contentSkip to conversation

block: Remove redundant plug in __submit_bio()

PATCH Applied [email protected] 2 participants 2 messages Jun 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 block: Remove redundant plug in __submit_bio()

From: Wen Xiong <[email protected]>

The patch removes the automatic plug/unplug operations from __submit_bio() that were added to cache nsecs time when no explicit plug is used.

The plug mechanism is most effective when batching multiple I/O operations together. Creating a plug for every bio submission provides minimal benefit while adding function call overhead and stack usage for every I/O operation.

Below is performance comparison with the latest upstream kernel.

Iotype  qd nj  rmix  mpstat busy  mpstat busy without plug
Randrw  1  20  100       53%                 24%
Randrw  1  40  100       70%                 24%
Randrw  1  20  70        40%                 24%
Randrw  1  40  70        60%                 26%
Randrw  1  20  0         14%                 6%
Randrw  1  40  0         20%                 7%
Fixes 060406c61c7c ("block: add plug while submitting IO")
---
 block/blk-core.c | 7 -------
 1 file changed, 7 deletions(-)
block/blk-core.c +0 -7
index 73a41df98c9a..365641266c9e 100644
@@ -669,11 +669,6 @@ static inline blk_status_t blk_check_zone_append(struct request_queue *q,
 
 static void __submit_bio(struct bio *bio)
 {
-	/* If plug is not used, add new plug here to cache nsecs time. */
-	struct blk_plug plug;
-
-	blk_start_plug(&plug);
-
 	if (!bdev_test_flag(bio->bi_bdev, BD_HAS_SUBMIT_BIO)) {
 		blk_mq_submit_bio(bio);
 	} else if (likely(bio_queue_enter(bio) == 0)) {
@@ -686,8 +681,6 @@ static void __submit_bio(struct bio *bio)
 			disk->fops->submit_bio(bio);
 		blk_queue_exit(disk->queue);
 	}
-
-	blk_finish_plug(&plug);
 }
 
 /*
Signature · 1 line
2.52.0
maintainer Applied
#1 lore raw
Quoted 9 lines · On Tue, 16 Jun 2026 10:31:21 -0400, [email protected] wrote:

The patch removes the automatic plug/unplug operations from __submit_bio() that were added to cache nsecs time when no explicit plug is used.

The plug mechanism is most effective when batching multiple I/O operations together. Creating a plug for every bio submission provides minimal benefit while adding function call overhead and stack usage for every I/O operation.

[...]

Applied, thanks!

[1/1] block: Remove redundant plug in __submit_bio()

      commit: 9cbbac29d752fb5d95e375fa3685a359b89caa0a

Best regards,

Signature · 1 line
Jens Axboe