Skip to content

Commit ba0ffdd

Browse files
committed
block: bump max plugged deferred size from 16 to 32
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>
1 parent 0006707 commit ba0ffdd

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
@@ -2152,14 +2152,14 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
21522152
}
21532153

21542154
/*
2155-
* Allow 4x BLK_MAX_REQUEST_COUNT requests on plug queue for multiple
2155+
* Allow 2x BLK_MAX_REQUEST_COUNT requests on plug queue for multiple
21562156
* queues. This is important for md arrays to benefit from merging
21572157
* requests.
21582158
*/
21592159
static inline unsigned short blk_plug_max_rq_count(struct blk_plug *plug)
21602160
{
21612161
if (plug->multiple_queues)
2162-
return BLK_MAX_REQUEST_COUNT * 4;
2162+
return BLK_MAX_REQUEST_COUNT * 2;
21632163
return BLK_MAX_REQUEST_COUNT;
21642164
}
21652165

‎block/blk.h‎

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

227+
/*
228+
* Plug flush limits
229+
*/
230+
#define BLK_MAX_REQUEST_COUNT 32
231+
#define BLK_PLUG_FLUSH_SIZE (128 * 1024)
232+
227233
/*
228234
* Internal elevator interface
229235
*/

‎include/linux/blkdev.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,6 @@ struct blk_plug {
727727
bool multiple_queues;
728728
bool nowait;
729729
};
730-
#define BLK_MAX_REQUEST_COUNT 16
731-
#define BLK_PLUG_FLUSH_SIZE (128 * 1024)
732730

733731
struct blk_plug_cb;
734732
typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *, bool);

0 commit comments

Comments
 (0)