From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>, linux-block@vger.kernel.org
Subject: Re: [PATCH 1/3] block: bump max plugged deferred size from 16 to 32
Date: Wed, 6 Oct 2021 12:05:13 -0600 [thread overview]
Message-ID: <f92df44f-5cb5-43ef-cbc9-56733fbb7659@kernel.dk> (raw)
In-Reply-To: <54e098e5-8230-a04f-e4fa-83a9cfa94649@acm.org>
On 10/6/21 11:55 AM, Bart Van Assche wrote:
> On 10/6/21 9:35 AM, Jens Axboe wrote:
>> 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.
>>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
>> ---
>> block/blk-mq.c | 4 ++--
>> include/linux/blkdev.h | 2 +-
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/block/blk-mq.c b/block/blk-mq.c
>> index a40c94505680..5327abbefbab 100644
>> --- a/block/blk-mq.c
>> +++ b/block/blk-mq.c
>> @@ -2145,14 +2145,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;
>> }
>>
>> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
>> index b19172db7eef..534298ac73cc 100644
>> --- a/include/linux/blkdev.h
>> +++ b/include/linux/blkdev.h
>> @@ -727,7 +727,7 @@ struct blk_plug {
>> bool multiple_queues;
>> bool nowait;
>> };
>> -#define BLK_MAX_REQUEST_COUNT 16
>> +#define BLK_MAX_REQUEST_COUNT 32
>> #define BLK_PLUG_FLUSH_SIZE (128 * 1024)
>>
>> struct blk_plug_cb;
>
> Since BLK_MAX_REQUEST_COUNT is only used inside the block layer core but
> not by any block driver, can it be moved from include/linux/blkdev.h
> into block/blk-mq.h?
Good point, I'll move it in there as part of the patch.
--
Jens Axboe
next prev parent reply other threads:[~2021-10-06 18:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 16:35 [PATCHSET RFC 0/3] Add plug based request allocation batching Jens Axboe
2021-10-06 16:35 ` [PATCH 1/3] block: bump max plugged deferred size from 16 to 32 Jens Axboe
2021-10-06 17:55 ` Bart Van Assche
2021-10-06 18:05 ` Jens Axboe [this message]
2021-10-06 16:35 ` [PATCH 2/3] block: pre-allocate requests if plug is started and is a batch Jens Axboe
2021-10-06 18:24 ` Bart Van Assche
2021-10-06 18:27 ` Jens Axboe
2021-10-06 16:35 ` [PATCH 3/3] io_uring: inform block layer of how many requests we are submitting Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2021-10-06 23:13 [PATCHSET v2 0/3] Add plug based request allocation batching Jens Axboe
2021-10-06 23:13 ` [PATCH 1/3] block: bump max plugged deferred size from 16 to 32 Jens Axboe
2021-10-12 10:04 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f92df44f-5cb5-43ef-cbc9-56733fbb7659@kernel.dk \
--to=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.