All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Pearson, Robert B" <robert.pearson2@hpe.com>
Cc: Bob Pearson <rpearsonhpe@gmail.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Guoqing Jiang <guoqing.jiang@linux.dev>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: Inconsistent lock state warning for rxe_poll_cq()
Date: Tue, 15 Feb 2022 12:48:10 -0400	[thread overview]
Message-ID: <20220215164810.GW4160@nvidia.com> (raw)
In-Reply-To: <PH7PR84MB1488ADD314438A8EDEB5F219BC349@PH7PR84MB1488.NAMPRD84.PROD.OUTLOOK.COM>

On Tue, Feb 15, 2022 at 04:45:01PM +0000, Pearson, Robert B wrote:
> 
> 
> From: Jason Gunthorpe <jgg@nvidia.com> 
> Sent: Tuesday, February 15, 2022 8:42 AM
> To: Bob Pearson <rpearsonhpe@gmail.com>
> Cc: Bart Van Assche <bvanassche@acm.org>; Guoqing Jiang <guoqing.jiang@linux.dev>; linux-rdma@vger.kernel.org
> Subject: Re: Inconsistent lock state warning for rxe_poll_cq()
> 
> On Mon, Feb 14, 2022 at 11:43:40PM -0600, Bob Pearson wrote:
> 
> >> in the write_unlock_bh() call. This appears to complain if hardirqs 
> >> are not enabled on the current cpu. This only happens if 
> >> CONFIG_PROVE_LOCKING=y.
> 
> > The trace shows this context is called within a irq disabled spinlock region. Ie this is trying to do
> 
> >   spinlock_irqsave()
> >   write_lock_bh()
> >   write_unlock_bh()
> >   spinunlock_irqrestore()
> 
> > Which is illegal locking.
> 
> > Jason
> 
> Yes. I figured that. But I don't know why, or why
> 
> spin_lock_irqsave(lock_a)
> spin_lock_irqsave(lock_b)
> spin_unlock_irqrestore(lock_b)
> spin_unlock_irqrestore(lock_a)
> 
> Is clearly better which has been suggested as a fix.

Right

> Apparently someone above me is taking an irqsave lock and then
> calling

Yes, the CM code

> Down to rxe_create_ah().

Yep

> Calling the verbs APIs while holding a spinlock seems likely to
> cause problems.

Indeed, I hate it, but it is hard to fix

> This looks to be in response to receiving a MAD so possibly is a
> call to ibv_create_ah_from_wc().

Yes something like that

Jason

  reply	other threads:[~2022-02-15 16:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14 18:01 Inconsistent lock state warning for rxe_poll_cq() Bart Van Assche
2022-02-14 19:51 ` Bob Pearson
2022-02-14 19:55   ` Bart Van Assche
2022-02-14 20:25     ` Bob Pearson
2022-02-14 20:48       ` Bart Van Assche
2022-02-15  5:43         ` Bob Pearson
2022-02-15 12:16           ` Guoqing Jiang
2022-02-15 14:41           ` Jason Gunthorpe
2022-02-15 16:45             ` Pearson, Robert B
2022-02-15 16:48               ` Jason Gunthorpe [this message]
2022-02-15 16:53                 ` Pearson, Robert B
2022-02-15 17:01                   ` Jason Gunthorpe
2022-02-15 17:18                     ` Haakon Bugge
2022-02-15  4:50 ` Guoqing Jiang

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=20220215164810.GW4160@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bvanassche@acm.org \
    --cc=guoqing.jiang@linux.dev \
    --cc=linux-rdma@vger.kernel.org \
    --cc=robert.pearson2@hpe.com \
    --cc=rpearsonhpe@gmail.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.