]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
block: bump max plugged deferred size from 16 to 32
authorJens Axboe <axboe@kernel.dk>
Wed, 6 Oct 2021 18:01:07 +0000 (12:01 -0600)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:16 +0000 (09:48 +0100)
BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit ba0ffdd8ce48ad7f7e85191cd29f9674caca3745 ]

Particularly for NVMe with efficient deferred submission for many
requests, there are nice benefits to be seen by bumping the default max
plug count from 16 to 32. This is especially true for virtualized setups,
where the submit part is more expensive. But can be noticed even on
native hardware.

Reduce the multiple queue factor from 4 to 2, since we're changing the
default size.

While changing it, move the defines into the block layer private header.
These aren't values that anyone outside of the block layer uses, or
should use.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
block/blk-mq.c
block/blk.h
include/linux/blkdev.h

index 652a31fc3bb389c8f95f3056d9b72bea5c4b98aa..49587c181e3fd35478da102530427b2d1b2ec593 100644 (file)
@@ -2148,14 +2148,14 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
 }
 
 /*
- * Allow 4x BLK_MAX_REQUEST_COUNT requests on plug queue for multiple
+ * Allow 2x BLK_MAX_REQUEST_COUNT requests on plug queue for multiple
  * queues. This is important for md arrays to benefit from merging
  * requests.
  */
 static inline unsigned short blk_plug_max_rq_count(struct blk_plug *plug)
 {
        if (plug->multiple_queues)
-               return BLK_MAX_REQUEST_COUNT * 4;
+               return BLK_MAX_REQUEST_COUNT * 2;
        return BLK_MAX_REQUEST_COUNT;
 }
 
index 6c3c00a8fe19d3f4f926d3deb9f26d63577c6f3c..aab72194d2266fbe75fa416dfd9106894df4ab32 100644 (file)
@@ -184,6 +184,12 @@ bool blk_bio_list_merge(struct request_queue *q, struct list_head *list,
 void blk_account_io_start(struct request *req);
 void blk_account_io_done(struct request *req, u64 now);
 
+/*
+ * Plug flush limits
+ */
+#define BLK_MAX_REQUEST_COUNT  32
+#define BLK_PLUG_FLUSH_SIZE    (128 * 1024)
+
 /*
  * Internal elevator interface
  */
index 12b9dbcc980ee476398ad6ba36896d3c9b2d2dfa..683aee3654200995453d2700cdfe084eadbb3d2d 100644 (file)
@@ -1198,8 +1198,6 @@ struct blk_plug {
        bool multiple_queues;
        bool nowait;
 };
-#define BLK_MAX_REQUEST_COUNT 16
-#define BLK_PLUG_FLUSH_SIZE (128 * 1024)
 
 struct blk_plug_cb;
 typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *, bool);