All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Shifeng Li <lishifeng@sangfor.com.cn>
Cc: Ding Hui <dinghui@sangfor.com.cn>,
	leon@kernel.org, wenglianfa@huawei.com, gustavoars@kernel.org,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shifeng Li <lishifeng1992@126.com>
Subject: Re: [PATCH] RDMA/device: Fix a race between mad_client and cm_client init
Date: Wed, 31 Jan 2024 20:04:08 -0400	[thread overview]
Message-ID: <20240201000408.GG50608@ziepe.ca> (raw)
In-Reply-To: <5bc6ed6d-31e9-4b44-aa91-5f9d0f3d92c8@sangfor.com.cn>

On Fri, Jan 26, 2024 at 10:25:01AM +0800, Shifeng Li wrote:
> > I believe this modification is effective, rather than expanding the clients_rwsem range,
> > the key point is down_write(&devices_rwsem), which prevents ib_register_client() from
> > being executed in the gap of ib_register_device().
> > 
> > However, this may cause a little confusion, as ib_register_client() does not modify
> > anything related to devices, but it is protected by a write lock.
> > 
> Do you have any differing opinions about above?

I'd rather see the client side have a comment explaining the confusing
lock then disturb the locking on the devices side..

I think the write/read lock scheme there was done for a reason I just
haven't had time to recall exactly why..

Please send a patch with this arrangement

Jason

      reply	other threads:[~2024-02-01  0:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02  3:43 [PATCH] RDMA/device: Fix a race between mad_client and cm_client init Shifeng Li
2024-01-02  8:58 ` Leon Romanovsky
2024-01-02 11:33   ` Shifeng Li
2024-01-02 11:58     ` Leon Romanovsky
2024-01-02 12:30       ` Shifeng Li
2024-01-03 18:48 ` Jason Gunthorpe
     [not found]   ` <80cac9fd-7fed-403e-8889-78e2fc7a49b0@sangfor.com.cn>
2024-01-04 12:37     ` Jason Gunthorpe
2024-01-05  8:15       ` Shifeng Li
2024-01-05 14:19         ` Jason Gunthorpe
2024-01-15  3:27           ` Shifeng Li
2024-01-06  2:12       ` Ding Hui
2024-01-15 13:47         ` Jason Gunthorpe
     [not found]           ` <354e2bf7-a8b4-629d-3d2d-35951a52e8bd@sangfor.com.cn>
2024-01-26  2:25             ` Shifeng Li
2024-02-01  0:04               ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240201000408.GG50608@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=dinghui@sangfor.com.cn \
    --cc=gustavoars@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=lishifeng1992@126.com \
    --cc=lishifeng@sangfor.com.cn \
    --cc=wenglianfa@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.