On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote:
> diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
> index 50c6485cb04f..7b7a366a97f3 100644
> --- a/include/linux/blk-mq.h
> +++ b/include/linux/blk-mq.h
> @@ -30,6 +30,8 @@ struct blk_mq_hw_ctx {
>  
>       struct sbitmap          ctx_map;
>  
> +     struct blk_mq_ctx       *dispatch_from;
> +
>       struct blk_mq_ctx       **ctxs;
>       unsigned int            nr_ctx;

Hello Ming,

Are you relying here on the fact that the per-CPU queues are never
reallocated, even if CPU hot-plugging occurs? Sorry but that seems fragile
to me. I would like to see 'dispatch_from' be converted into an integer. It
is easy to check whether an integer software queue index is out of range
but it's not that easy to check whether a pointer became invalid.

Thanks,

Bart.

Reply via email to