From: Leon Romanovsky <leon@kernel.org>
To: Jinpu Wang <jinpu.wang@cloud.ionos.com>
Cc: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>,
linux-rdma@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
Danil Kipnis <danil.kipnis@cloud.ionos.com>
Subject: Re: [PATCH for-next 02/18] RMDA/rtrs-srv: Occasionally flush ongoing session closing
Date: Fri, 11 Dec 2020 22:49:32 +0200 [thread overview]
Message-ID: <20201211204932.GB192848@unreal> (raw)
In-Reply-To: <CAMGffEnuNHacxqqdZsF0JMk3kTUqT9KdzNK_QzBF_FWjPWLN8Q@mail.gmail.com>
On Fri, Dec 11, 2020 at 08:58:09AM +0100, Jinpu Wang wrote:
> On Fri, Dec 11, 2020 at 8:53 AM Jinpu Wang <jinpu.wang@cloud.ionos.com> wrote:
> >
> > On Fri, Dec 11, 2020 at 8:26 AM Leon Romanovsky <leon@kernel.org> wrote:
> > >
> > > On Fri, Dec 11, 2020 at 07:50:13AM +0100, Jinpu Wang wrote:
> > > > On Fri, Dec 11, 2020 at 3:35 AM Guoqing Jiang
> > > > <guoqing.jiang@cloud.ionos.com> wrote:
> > > > >
> > > > >
> > > > >
> > > > > On 12/10/20 15:56, Jinpu Wang wrote:
> > > > > > On Wed, Dec 9, 2020 at 5:45 PM Jack Wang <jinpu.wang@cloud.ionos.com> wrote:
> > > > > >>
> > > > > >> If there are many establishments/teardowns, we need to make sure
> > > > > >> we do not consume too much system memory. Thus let on going
> > > > > >> session closing to finish before accepting new connection.
> > > > > >>
> > > > > >> Inspired by commit 777dc82395de ("nvmet-rdma: occasionally flush ongoing controller teardown")
> > > > > >> Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> > > > > >> Reviewed-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
> > > > > > Please ignore this one, it could lead to deadlock, due to the fact
> > > > > > cma_ib_req_handler is holding
> > > > > > mutex_lock(&listen_id->handler_mutex) when calling into
> > > > > > rtrs_rdma_connect, we call close_work which will call rdma_destroy_id,
> > > > > > which
> > > > > > could try to hold the same handler_mutex, so deadlock.
> > > > > >
> > > > >
> > > > > I am wondering if nvmet-rdma has the similar issue or not, if so, maybe
> > > > > introduce a locked version of rdma_destroy_id.
> > > > >
> > > > > Thanks,
> > > > > Guoqing
> > > >
> > > > No, I was wrong. I rechecked the code, it's not a valid deadlock, in
> > > > cma_ib_req_handler, the conn_id is newly created in
> > > > https://elixir.bootlin.com/linux/latest/source/drivers/infiniband/core/cma.c#L2185.
> > > >
> > > > Flush_workqueue will only flush close_work for any other cm_id, but
> > > > not the newly created one conn_id, it has not associated with anything
> > > > yet.
> > > >
> > > > The same applies to nvme-rdma. so it's a false alarm by lockdep.
> > >
> > > Leaving this without fix (proper lock annotation) is not right thing to
> > > do, because everyone who runs rtrs code with LOCKDEP on will have same
> > > "false alarm".
> > >
> > > So I recommend or not to take this patch or write it without LOCKDEP warning.
> > Hi Leon,
> >
> > I'm thinking about the same, do you have a suggestion on how to teach
> > LOCKDEP this is not really a deadlock,
> > I do not know LOCKDEP well.
> Found it myself, we can use lockdep_off
>
> https://elixir.bootlin.com/linux/latest/source/drivers/virtio/virtio_mem.c#L699
My personal experience from internal/external reviews shows that claims
about false alarms in LOCKDEP warnings are almost always wrong.
Thanks
>
> Thanks
>
> >
> > Thanks
> > >
> > > Thanks
> > >
> > > >
> > > > Regards!
> > > > Jack
next prev parent reply other threads:[~2020-12-11 21:42 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 16:45 [PATCH for-next 00/18] Misc update for rtrs Jack Wang
2020-12-09 16:45 ` [PATCH for-next 01/18] RDMA/rtrs: Extend ibtrs_cq_qp_create Jack Wang
2020-12-09 16:45 ` [PATCH for-next 02/18] RMDA/rtrs-srv: Occasionally flush ongoing session closing Jack Wang
2020-12-10 14:56 ` Jinpu Wang
2020-12-11 2:33 ` Guoqing Jiang
2020-12-11 6:50 ` Jinpu Wang
2020-12-11 7:26 ` Leon Romanovsky
2020-12-11 7:53 ` Jinpu Wang
2020-12-11 7:58 ` Jinpu Wang
2020-12-11 13:45 ` Jason Gunthorpe
[not found] ` <CAD+HZHXso=S5c=MqgrmDMZpWi10FbPTinWPfLMTkMCCiosihCQ@mail.gmail.com>
2020-12-11 16:29 ` Jason Gunthorpe
2020-12-16 16:42 ` Jinpu Wang
2020-12-27 9:01 ` Leon Romanovsky
2021-01-04 8:06 ` Jinpu Wang
2021-01-04 8:25 ` Leon Romanovsky
2021-01-04 11:04 ` Jinpu Wang
2020-12-11 20:49 ` Leon Romanovsky [this message]
2020-12-09 16:45 ` [PATCH for-next 03/18] RDMA/rtrs-srv: Release lock before call into close_sess Jack Wang
2020-12-09 16:45 ` [PATCH for-next 04/18] RDMA/rtrs-srv: Use sysfs_remove_file_self for disconnect Jack Wang
2020-12-09 16:45 ` [PATCH for-next 05/18] RDMA/rtrs-clt: Set mininum limit when create QP Jack Wang
2020-12-09 16:45 ` [PATCH for-next 06/18] RDMA/rtrs-srv: Jump to dereg_mr label if allocate iu fails Jack Wang
2020-12-09 16:45 ` [PATCH for-next 07/18] RDMA/rtrs: Call kobject_put in the failure path Jack Wang
2020-12-09 16:45 ` [PATCH for-next 08/18] RDMA/rtrs-clt: Consolidate rtrs_clt_destroy_sysfs_root_{folder,files} Jack Wang
2020-12-09 16:45 ` [PATCH for-next 09/18] RDMA/rtrs-clt: Kill wait_for_inflight_permits Jack Wang
2020-12-09 16:45 ` [PATCH for-next 10/18] RDMA/rtrs-clt: Remove unnecessary 'goto out' Jack Wang
2020-12-09 16:45 ` [PATCH for-next 11/18] RDMA/rtrs-clt: Kill rtrs_clt_change_state Jack Wang
2020-12-09 16:45 ` [PATCH for-next 12/18] RDMA/rtrs-clt: Rename __rtrs_clt_change_state to rtrs_clt_change_state Jack Wang
2020-12-09 16:45 ` [PATCH for-next 13/18] RDMA/rtrs-srv: Fix missing wr_cqe Jack Wang
2020-12-09 16:45 ` [PATCH for-next 14/18] RDMA/rtrs-clt: Refactor the failure cases in alloc_clt Jack Wang
2020-12-09 16:45 ` [PATCH for-next 15/18] RDMA/rtrs: Do not signal for heatbeat Jack Wang
2020-12-09 16:45 ` [PATCH for-next 16/18] RDMA/rtrs-clt: Use bitmask to check sess->flags Jack Wang
2020-12-09 16:45 ` [PATCH for-next 17/18] RDMA/rtrs-srv: Do not signal REG_MR Jack Wang
2020-12-09 16:45 ` [PATCH for-next 18/18] RDMA/rtrs-srv: Init wr_cnt as 1 Jack Wang
2020-12-11 19:48 ` [PATCH for-next 00/18] Misc update for rtrs Jason Gunthorpe
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=20201211204932.GB192848@unreal \
--to=leon@kernel.org \
--cc=bvanassche@acm.org \
--cc=danil.kipnis@cloud.ionos.com \
--cc=dledford@redhat.com \
--cc=guoqing.jiang@cloud.ionos.com \
--cc=jgg@ziepe.ca \
--cc=jinpu.wang@cloud.ionos.com \
--cc=linux-rdma@vger.kernel.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