[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <62db1a02-41b8-44b0-960b-6d6f5bec5d19@sangfor.com.cn>
Date: Fri, 5 Jan 2024 16:15:18 +0800
From: Shifeng Li <lishifeng@...gfor.com.cn>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: leon@...nel.org, wenglianfa@...wei.com, gustavoars@...nel.org,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org,
Shifeng Li <lishifeng1992@....com>, "Ding, Hui" <dinghui@...gfor.com.cn>
Subject: Re: [PATCH] RDMA/device: Fix a race between mad_client and cm_client
init
On 2024/1/4 20:37, Jason Gunthorpe wrote:
> On Thu, Jan 04, 2024 at 02:48:14PM +0800, Shifeng Li wrote:
>
>> The root cause is that mad_client and cm_client may init concurrently
>> when devices_rwsem write semaphore is downgraded in enable_device_and_get() like:
>
> That can't be true, the module loader infrastructue ensures those two
> things are sequential.
>
I'm a bit confused how the module loader infrastructue ensures that mad_client.add() and
cm_client.add() are sequential. Could you explain in more detail please?
We know that the ib_cm driver and mlx5_ib driver can load concurrently.
Thanks.
> You are trying to say that the post-client fixup stuff will still see
> the DEVICE_REGISTERED before it reaches the clients_rwsem lock?
>
> That probably just says the clients_rwsem should be obtained before
> changing the DEVICE_STATE too :\
>
> Jason
>
Powered by blists - more mailing lists