Re: [PATCH 04/14] block: take io_opt and io_min into account for max_sectors
- To: Christoph Hellwig <hch@lst.de>
- Cc: Jens Axboe <axboe@kernel.dk>, "Martin K. Petersen" <martin.petersen@oracle.com>, Richard Weinberger <richard@nod.at>, Anton Ivanov <anton.ivanov@cambridgegreys.com>, Johannes Berg <johannes@sipsolutions.net>, Josef Bacik <josef@toxicpanda.com>, Dongsheng Yang <dongsheng.yang@easystack.cn>, Roger Pau Monné <roger.pau@citrix.com>, linux-um@lists.infradead.org, linux-block@vger.kernel.org, nbd@other.debian.org, ceph-devel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>, Damien Le Moal <dlemoal@kernel.org>
- Subject: Re: [PATCH 04/14] block: take io_opt and io_min into account for max_sectors
- From: Ilya Dryomov <idryomov@gmail.com>
- Date: Fri, 31 May 2024 11:11:00 +0200
- Message-id: <[🔎] CAOi1vP-+j-RHLmnDLpsZREnYb_f7QGGhRC9YOgctsFNuE7yM3Q@mail.gmail.com>
- In-reply-to: <[🔎] 20240531074837.1648501-5-hch@lst.de>
- References: <[🔎] 20240531074837.1648501-1-hch@lst.de> <[🔎] 20240531074837.1648501-5-hch@lst.de>
On Fri, May 31, 2024 at 9:48 AM Christoph Hellwig <hch@lst.de> wrote:
>
> The soft max_sectors limit is normally capped by the hardware limits and
> an arbitrary upper limit enforced by the kernel, but can be modified by
> the user. A few drivers want to increase this limit (nbd, rbd) or
> adjust it up or down based on hardware capabilities (sd).
>
> Change blk_validate_limits to default max_sectors to the optimal I/O
> size, or upgrade it to the preferred minimal I/O size if that is
> larger than the kernel default if no optimal I/O size is provided based
> on the logic in the SD driver.
>
> This keeps the existing kernel default for drivers that do not provide
> an io_opt or very big io_min value, but picks a much more useful
> default for those who provide these hints, and allows to remove the
> hacks to set the user max_sectors limit in nbd, rbd and sd.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> block/blk-settings.c | 7 +++++++
> drivers/block/nbd.c | 2 +-
For rbd
> drivers/block/rbd.c | 1 -
Acked-by: Ilya Dryomov <idryomov@gmail.com>
Thanks,
Ilya
Reply to: