Skip to content

Commit b34ea3c

Browse files
axboegregkh
authored andcommitted
block: bump max plugged deferred size from 16 to 32
[ Upstream commit ba0ffdd ] 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>
1 parent 517feec commit b34ea3c

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

block/blk-mq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,14 +2116,14 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
21162116
}
21172117

21182118
/*
2119-
* Allow 4x BLK_MAX_REQUEST_COUNT requests on plug queue for multiple
2119+
* Allow 2x BLK_MAX_REQUEST_COUNT requests on plug queue for multiple
21202120
* queues. This is important for md arrays to benefit from merging
21212121
* requests.
21222122
*/
21232123
static inline unsigned short blk_plug_max_rq_count(struct blk_plug *plug)
21242124
{
21252125
if (plug->multiple_queues)
2126-
return BLK_MAX_REQUEST_COUNT * 4;
2126+
return BLK_MAX_REQUEST_COUNT * 2;
21272127
return BLK_MAX_REQUEST_COUNT;
21282128
}
21292129

block/blk.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ bool blk_bio_list_merge(struct request_queue *q, struct list_head *list,
188188
void blk_account_io_start(struct request *req);
189189
void blk_account_io_done(struct request *req, u64 now);
190190

191+
/*
192+
* Plug flush limits
193+
*/
194+
#define BLK_MAX_REQUEST_COUNT 32
195+
#define BLK_PLUG_FLUSH_SIZE (128 * 1024)
196+
191197
/*
192198
* Internal elevator interface
193199
*/

include/linux/blkdev.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,8 +1248,6 @@ struct blk_plug {
12481248
bool multiple_queues;
12491249
bool nowait;
12501250
};
1251-
#define BLK_MAX_REQUEST_COUNT 16
1252-
#define BLK_PLUG_FLUSH_SIZE (128 * 1024)
12531251

12541252
struct blk_plug_cb;
12551253
typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *, bool);

0 commit comments

Comments
 (0)