lkml.org 
[lkml]   [2018]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 10/14] blk-mq: initial support for multiple queue maps
From
Date
On Mon, 2018-10-29 at 10:37 -0600, Jens Axboe wrote:
> -static int cpu_to_queue_index(unsigned int nr_queues, const int cpu)
> +static int cpu_to_queue_index(struct blk_mq_queue_map *qmap,
> + unsigned int nr_queues, const int cpu)
> {
> - return cpu % nr_queues;
> + return qmap->queue_offset + (cpu % nr_queues);
> }
>
> [ ... ]
>
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -78,10 +78,11 @@ struct blk_mq_hw_ctx {
> struct blk_mq_queue_map {
> unsigned int *mq_map;
> unsigned int nr_queues;
> + unsigned int queue_offset;
> };

I think it's unfortunate that the blk-mq core uses the .queue_offset member but
that mapping functions in block drivers are responsible for setting that member.
Since the block driver mapping functions have to set blk_mq_queue_map.nr_queues,
how about adding a loop in blk_mq_update_queue_map() that derives .queue_offset
from .nr_queues from previous array entries?

Thanks,

Bart.

\
 
 \ /
  Last update: 2018-10-29 20:40    [W:0.251 / U:3.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site