Re: [PATCH rdma-next 6/6] IB/mlx5: Move locks initialization to the corresponding stage

Mark Bloch
2017-12-28T17:10:31Z

On 28/12/2017 18:03, Jason Gunthorpe wrote:
> On Thu, Dec 28, 2017 at 09:51:24AM +0200, Mark Bloch wrote:
>
>> Yes, let me explain.
>> This entire series aims to allow to turn on/off certain features and to
>> group the init/cleanup of those features together.
>> If you take that into account, the srcu (which is needed only for ODP)
>> needs to be done in the ODP stage, but the issue is that not only ODP code
>> uses the srcu, destroy_mkey() will sync on it.
>
> Okay, right, so this series creates the united srcu possibility. The
> commit messages are not totally clear..
>
>> So I can move the srcu initialization to INIT, but this way we lose
>> context when looking at the ODP stage.
>
> If something is being used by multiple stages then it really seems
> like it should be common.
>
> Introducing a function call back just to avoid initing a srcu in
> common code for the sole reason of 'keeping like together' seems
> like bad taste to me..

Well, it's not only that, moving the init srcu to the INIT stage
will also make me wrap it around with CONFIG_INFINIBAND_ON_DEMAND_PAGING
which I really don't like seeing in .c files, but we are already doing that
so .... :)

If you feel that strongly about it, let me know and I'll change that,
as well as the comment you had about the const in a different patch
and we'll send v1 with the fixes.

Thanks for the comments!

> Jason
>

Mark