On Thu, 2017-05-25 at 11:42 -0600, Jens Axboe wrote:
> Why not make it
> 
>       /* Must be the last member - see also blk_mq_hw_ctx_size(). */
>       struct srcu_struct      queue_rq_srcu[0];
> 
> and fixup blk_mq_hw_ctx_size()
> 
> static int blk_mq_hw_ctx_size(struct request_queue *q)
> {
>       int size = sizeof(struct blk_mq_hw_ctx);
> 
>       if (q->tag_set->flags & BLK_MQ_F_BLOCKING)
>               size += sizeof(struct srcu_struct);
> 
>       return size;
> }
> 
> I think that'd be cleaner. Keep the end-of-struct checking, just to be
> on the safe side.
> 
> Neither one is super pretty though, and still doesn't fix the fact that
> the srcu_struct is _half_ the blk_mq_hw_ctx in total.

Hello Jens,

Making these changes seems like a good idea to me. I will make these changes
and post a patch.

Bart.

Reply via email to