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:   Tue, 30 Oct 2018 17:59:47 -0700
From:   Sagi Grimberg <sagi@...mberg.me>
To:     Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
        linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/16] blk-mq: support multiple hctx maps


> diff --git a/block/blk-mq.h b/block/blk-mq.h
> index 1821f448f7c4..8329017badc8 100644
> --- a/block/blk-mq.h
> +++ b/block/blk-mq.h
> @@ -72,20 +72,37 @@ void blk_mq_try_issue_list_directly(struct blk_mq_hw_ctx *hctx,
>    */
>   extern int blk_mq_hw_queue_to_node(struct blk_mq_queue_map *qmap, unsigned int);
>   
> -static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q,
> -						     unsigned int flags,
> -						     unsigned int cpu)
> +/*
> + * blk_mq_map_queue_type() - map (hctx_type,cpu) to hardware queue
> + * @q: request queue
> + * @hctx_type: the hctx type index
> + * @cpu: CPU
> + */
> +static inline struct blk_mq_hw_ctx *blk_mq_map_queue_type(struct request_queue *q,
> +							  unsigned int hctx_type,
> +							  unsigned int cpu)
>   {
>   	struct blk_mq_tag_set *set = q->tag_set;
>   
> -	return q->queue_hw_ctx[set->map[0].mq_map[cpu]];
> +	return q->queue_hw_ctx[set->map[hctx_type].mq_map[cpu]];
>   }
>   
> -static inline struct blk_mq_hw_ctx *blk_mq_map_queue_type(struct request_queue *q,
> -							  unsigned int hctx_type,
> -							  unsigned int cpu)
> +/*
> + * blk_mq_map_queue() - map (cmd_flags,type) to hardware queue
> + * @q: request queue
> + * @flags: request command flags
> + * @cpu: CPU
> + */
> +static inline struct blk_mq_hw_ctx *blk_mq_map_queue(struct request_queue *q,
> +						     unsigned int flags,
> +						     unsigned int cpu)
>   {
> -	return blk_mq_map_queue(q, hctx_type, cpu);
> +	int hctx_type = 0;
> +
> +	if (q->mq_ops->flags_to_type)
> +		hctx_type = q->mq_ops->flags_to_type(q, flags);

nitpick: I think that rq_flags_to_type is a bit more descriptive here.
just a personal opinion.

Other than that,
Reviewed-by: Sagi Grimberg <sagi@...mberg.me>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ