mbox series

[RFC,V4,0/6] blk: make blk-rq-qos policies pluggable and modular

Message ID 20220217031349.98561-1-jianchao.wan9@gmail.com (mailing list archive)
Headers show
Series blk: make blk-rq-qos policies pluggable and modular | expand

Message

Wang Jianchao Feb. 17, 2022, 3:13 a.m. UTC
Hi Jens

blk-rq-qos is a standalone framework out of io-sched and can be used to
control or observe the IO progress in block-layer with hooks. blk-rq-qos
is a great design but right now, it is totally fixed and built-in and shut
out peoples who want to use it with external module.

This patchset attempts to make blk-rq-qos framework pluggable and modular.
Then we can update the blk-rq-qos policy module w/o stopping the IO workload.
And it is more convenient to introduce new policy on old machines w/o udgrade
kernel. And we can close all of the blk-rq-qos policy if we needn't any of
them. At the moment, the request_queue.rqos list is empty, we needn't to
waste cpu cyles on them.

Changes since v3:
 - Fix some code sytle issues
 - Rename policies to blk-wbt, blk-iolat, blk-iocost, blk-ioprio

Changes since v2:
 Refactor the patches,
 - patch01 only provide new interfaces and not export the sysfs interface.
 - patch02 adapt the wbt to new interface, reserve the previous action
   when write to wbt_lat
 - export sysfs interface in last patch when all of the blk-rqos policies
   are preprared well.

Changes since v1:
 - Just make iocost and iolatency pluggable, then we needn't to export
   those interfaces
 - Remove the iostat rqos policy
 - Rename module of blk-ioprio to io-prio to avoid rename ioprio.c file

WangJianchao(6):
	blk: prepare to make blk-rq-qos pluggable and modular
    blk-wbt: make wbt pluggable
    blk-iolatency: make iolatency pluggable
    blk-iocost: make iocost pluggable
    blk-ioprio: make ioprio pluggable and modular
    blk: export the sysfs for switching qos

 block/Kconfig          |   2 +-
 block/Makefile         |   3 +-
 block/blk-cgroup.c     |  11 ---
 block/blk-iocost.c     |  49 +++++++-----
 block/blk-iolatency.c  |  33 +++++++--
 block/blk-ioprio.c     |  50 ++++++++-----
 block/blk-ioprio.h     |  19 -----
 block/blk-mq-debugfs.c |  23 ++----
 block/blk-rq-qos.c     | 303 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 block/blk-rq-qos.h     |  96 +++++++++---------------
 block/blk-sysfs.c      |   2 +
 block/blk-wbt.c        |  52 +++++++++++--
 block/blk-wbt.h        |   7 +-
 block/blk.h            |   6 --
 include/linux/blkdev.h |   4 +
 15 files changed, 488 insertions(+), 172 deletions(-)

Comments

Jens Axboe Feb. 17, 2022, 3:21 a.m. UTC | #1
On 2/16/22 8:13 PM, Wang Jianchao (Kuaishou) wrote:
> Hi Jens
> 
> blk-rq-qos is a standalone framework out of io-sched and can be used to
> control or observe the IO progress in block-layer with hooks. blk-rq-qos
> is a great design but right now, it is totally fixed and built-in and shut
> out peoples who want to use it with external module.
> 
> This patchset attempts to make blk-rq-qos framework pluggable and modular.
> Then we can update the blk-rq-qos policy module w/o stopping the IO workload.
> And it is more convenient to introduce new policy on old machines w/o udgrade
> kernel. And we can close all of the blk-rq-qos policy if we needn't any of
> them. At the moment, the request_queue.rqos list is empty, we needn't to
> waste cpu cyles on them.

I like this patchset, would be a lot more convenient and helps
efficiency.

What kind of testing have you done on it?
Wang Jianchao Feb. 17, 2022, 3:53 a.m. UTC | #2
On 2022/2/17 11:21 上午, Jens Axboe wrote:
> On 2/16/22 8:13 PM, Wang Jianchao (Kuaishou) wrote:
>> Hi Jens
>>
>> blk-rq-qos is a standalone framework out of io-sched and can be used to
>> control or observe the IO progress in block-layer with hooks. blk-rq-qos
>> is a great design but right now, it is totally fixed and built-in and shut
>> out peoples who want to use it with external module.
>>
>> This patchset attempts to make blk-rq-qos framework pluggable and modular.
>> Then we can update the blk-rq-qos policy module w/o stopping the IO workload.
>> And it is more convenient to introduce new policy on old machines w/o udgrade
>> kernel. And we can close all of the blk-rq-qos policy if we needn't any of
>> them. At the moment, the request_queue.rqos list is empty, we needn't to
>> waste cpu cyles on them.
> 
> I like this patchset, would be a lot more convenient and helps
> efficiency.
> 
> What kind of testing have you done on it?
> 
I have run blktests against this patchset in a VM machine along with a new test
case for switching rqos policies while running IO. 

https://marc.info/?l=linux-block&m=164506848620632&w=2

And also there is a bit different version running on v4.18 with more tests

Thanks
Jianchao
Christoph Hellwig Feb. 17, 2022, 8:43 a.m. UTC | #3
On Thu, Feb 17, 2022 at 11:13:43AM +0800, Wang Jianchao (Kuaishou) wrote:
> Hi Jens
> 
> blk-rq-qos is a standalone framework out of io-sched and can be used to
> control or observe the IO progress in block-layer with hooks. blk-rq-qos
> is a great design but right now, it is totally fixed and built-in and shut
> out peoples who want to use it with external module.

And that's got.  External modules do not matter.

That being said this series has a bunch of nice cleanups, but we really
do not need the exports and modular build.
Wang Jianchao Feb. 18, 2022, 3:22 a.m. UTC | #4
On 2022/2/17 4:43 下午, Christoph Hellwig wrote:
> On Thu, Feb 17, 2022 at 11:13:43AM +0800, Wang Jianchao (Kuaishou) wrote:
>> Hi Jens
>>
>> blk-rq-qos is a standalone framework out of io-sched and can be used to
>> control or observe the IO progress in block-layer with hooks. blk-rq-qos
>> is a great design but right now, it is totally fixed and built-in and shut
>> out peoples who want to use it with external module.
> 
> And that's got.  External modules do not matter.
> 
> That being said this series has a bunch of nice cleanups, but we really
> do not need the exports and modular build.

Got it.
I will get rid of the code for supporting external module in next patch.

Thanks
Jianchao