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

Mark Bloch
2017-12-28T07:51:24Z

On 28/12/2017 07:35, Jason Gunthorpe wrote:
> On Thu, Dec 28, 2017 at 07:32:59AM +0200, Leon Romanovsky wrote:
>> On Wed, Dec 27, 2017 at 10:18:06PM -0700, Jason Gunthorpe wrote:
>>> On Sun, Dec 24, 2017 at 02:40:15PM +0200, Leon Romanovsky wrote:
>>>> From: Mark Bloch <markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>>>>
>>>> Unconditional locks/list initialization should be done in the INIT stage.
>>>> Remove those from the CAPS stage and move them to the proper stage.
>>>
>>> So why not always initialize the srcu instead of using that wonky
>>> callback function?
>>
>> Maybe, but now, it is out of scope for this series, which more or less
>> moves code from one place to another.
>
> So the possibility of an uninited SRCU existed before and this is
> fixing a bug? I had the impression this series was introducing that
> possibility...
>

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.

So I can move the srcu initialization to INIT, but this way we lose
context when looking at the ODP stage.

> Jason
>

Mark