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

From: Changheun Lee
Date: Tue Apr 13 2021 - 07:35:20 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?

Kernel will take a look this when page is merged to bio. And bio size will
be limited dynamically.

>
> 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?

Actually I didn't considerate userspace knob at first. And there is no tool,
no logic to change it. It's a kind of policy about bio max size.
One time setting will be OK on system boot time actually.

At the first, I suggested 1MB bio max size. It is same with bio max size
before applying of multipage bvec. But there are requests of big bio size
on another system environment, and feedback of knob for utility too.
So I made this as a optional for each system, and a knob too.

>
> thanks,
>
> greg k-h


Thanks,

Changheun Lee