lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Feb 2022 00:52:43 -0800
From:   Christoph Hellwig <hch@...radead.org>
To:     "Wang Jianchao (Kuaishou)" <jianchao.wan9@...il.com>
Cc:     Jens Axboe <axboe@...nel.dk>, Josef Bacik <jbacik@...com>,
        Tejun Heo <tj@...nel.org>,
        Bart Van Assche <bvanassche@....org>,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC V4 4/6] blk-iocost: make iocost pluggable

On Thu, Feb 17, 2022 at 11:13:47AM +0800, Wang Jianchao (Kuaishou) wrote:
> Make blk-iocost pluggable. Then we can close or open it through
> /sys/block/xxx/queue/qos.
> 
> Signed-off-by: Wang Jianchao (Kuaishou) <jianchao.wan9@...il.com>
> ---
>  block/blk-iocost.c     | 52 ++++++++++++++++++++++++++----------------
>  block/blk-mq-debugfs.c |  2 --
>  block/blk-rq-qos.h     |  1 -
>  3 files changed, 32 insertions(+), 23 deletions(-)
> 
> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
> index 769b64394298..5a3a45985b49 100644
> --- a/block/blk-iocost.c
> +++ b/block/blk-iocost.c
> @@ -660,9 +660,10 @@ static struct ioc *rqos_to_ioc(struct rq_qos *rqos)
>  	return container_of(rqos, struct ioc, rqos);
>  }
>  
> +static struct rq_qos_ops ioc_rqos_ops;
>  static struct ioc *q_to_ioc(struct request_queue *q)
>  {
> -	return rqos_to_ioc(rq_qos_id(q, RQ_QOS_COST));
> +	return rqos_to_ioc(rq_qos_by_id(q, ioc_rqos_ops.id));
>  }

This has a single caller, so just open code it.

> +static int blk_iocost_init(struct request_queue *q);
> +
>  static struct rq_qos_ops ioc_rqos_ops = {
> +	.name = "blk-iocost",
> +	.flags = RQOS_FLAG_CGRP_POL,
>  	.throttle = ioc_rqos_throttle,
>  	.merge = ioc_rqos_merge,
>  	.done_bio = ioc_rqos_done_bio,
>  	.done = ioc_rqos_done,
>  	.queue_depth_changed = ioc_rqos_queue_depth_changed,
>  	.exit = ioc_rqos_exit,
> +	.init = blk_iocost_init,
>  };

Again, move rq_qos_ops below the init function to avoid the forward
declaration.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ