public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Haggai Eran <haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 01/13] IB/core: lock client data with lists_rwsem
Date: Mon, 27 Jul 2015 11:44:21 -0600	[thread overview]
Message-ID: <20150727174421.GE18348@obsidianresearch.com> (raw)
In-Reply-To: <1437924832-18327-2-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

On Sun, Jul 26, 2015 at 06:33:40PM +0300, Haggai Eran wrote:
> An ib_client callback that is called with the lists_rwsem locked only for
> read is protected from changes to the IB client lists, but not from
> ib_unregister_device() freeing its client data. This is because
> ib_unregister_device() will remove the device from the device list with
> lists_rwsem locked for write, but perform the rest of the cleanup,
> including the call to remove() without that lock.
> 
> Mark client data that is undergoing de-registration with a new going_down
> flag in the client data context. Lock the client data list with lists_rwsem
> for write in addition to using the spinlock, so that functions calling the
> callback would be able to lock only lists_rwsem for read and let callbacks
> sleep.
> 
> Since ib_unregister_client() now marks the client data context, no need for
> remove() to search the context again, so pass the client data directly to
> remove() callbacks.

This looks fine to me..

Reviewed-By: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-07-27 17:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-26 15:33 [PATCH v2 00/13] Demux IB CM requests in the rdma_cm module Haggai Eran
     [not found] ` <1437924832-18327-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-26 15:33   ` [PATCH v2 01/13] IB/core: lock client data with lists_rwsem Haggai Eran
     [not found]     ` <1437924832-18327-2-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-27 17:44       ` Jason Gunthorpe [this message]
2015-07-26 15:33   ` [PATCH v2 02/13] IB/core: Find the network device matching connection parameters Haggai Eran
     [not found]     ` <1437924832-18327-3-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-27 17:45       ` Jason Gunthorpe
     [not found]         ` <20150727174522.GF18348-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-07-28  8:16           ` Haggai Eran
2015-07-26 15:33   ` [PATCH v2 03/13] IB/ipoib: Return IPoIB devices " Haggai Eran
2015-07-26 15:33   ` [PATCH v2 04/13] IB/cm: Expose service ID in request events Haggai Eran
2015-07-26 15:33   ` [PATCH v2 05/13] IB/cm: Share listening CM IDs Haggai Eran
     [not found]     ` <1437924832-18327-6-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-27 19:04       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373A901F86B-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-07-28  8:25           ` Haggai Eran
     [not found]             ` <55B73C86.30608-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-28 17:05               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A82373A901FE5D-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-07-29  6:34                   ` Haggai Eran
2015-07-26 15:33   ` [PATCH v2 06/13] IB/cma: Refactor RDMA IP CM private-data parsing code Haggai Eran
2015-07-26 15:33   ` [PATCH v2 07/13] IB/cma: Helper functions to access port space IDRs Haggai Eran
     [not found]     ` <1437924832-18327-8-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-27 22:48       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373A901F965-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-07-28  8:55           ` Haggai Eran
2015-07-26 15:33   ` [PATCH v2 08/13] IB/cm: Expose BTH P_Key in CM and SIDR request events Haggai Eran
2015-07-26 15:33   ` [PATCH v2 09/13] IB/cma: Add net_dev and private data checks to RDMA CM Haggai Eran
     [not found]     ` <1437924832-18327-10-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-07-27 23:07       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373A901F99B-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-07-28  8:12           ` Haggai Eran
2015-07-26 15:33   ` [PATCH v2 10/13] IB/cma: Validate routing of incoming requests Haggai Eran
2015-07-26 15:33   ` [PATCH v2 11/13] IB/cma: Use found net_dev for passive connections Haggai Eran
2015-07-26 15:33   ` [PATCH v2 12/13] IB/cma: Share ib_cm_ids between rdma_cm_ids Haggai Eran
2015-07-26 15:33   ` [PATCH v2 13/13] IB/cm: Remove compare_data checks Haggai Eran

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=20150727174421.GE18348@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox