Re: [PATCH v7 3/3] bio: add limit_bio_size sysfs

From: Greg KH
Date: Tue Apr 13 2021 - 03:35:15 EST


On Tue, Apr 13, 2021 at 11:55:02AM +0900, Changheun Lee wrote:
> Add limit_bio_size block sysfs node to limit bio size.
> Queue flag QUEUE_FLAG_LIMIT_BIO_SIZE will be set if limit_bio_size is set.
> And bio max size will be limited by queue max sectors via
> QUEUE_FLAG_LIMIT_BIO_SIZE set.
>
> Signed-off-by: Changheun Lee <nanich.lee@xxxxxxxxxxx>
> ---
> Documentation/ABI/testing/sysfs-block | 10 ++++++++++
> Documentation/block/queue-sysfs.rst | 7 +++++++
> block/blk-sysfs.c | 3 +++
> 3 files changed, 20 insertions(+)

Isn't it too late to change the sysfs entry after the device has been
probed and initialized by the kernel as the kernel does not look at this
value after that?

Why do you need a userspace knob for this? What tool is going to ever
change this, and what logic is it going to use to change it? Why can't
the kernel also just "do the right thing" and properly detect this
option as well as userspace can?

thanks,

greg k-h