[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADGDV=XkfuNhATA4GkQm1VBVaG+JkFYmXojaVSnGo=rco7bUyQ@mail.gmail.com>
Date: Thu, 25 Sep 2025 08:02:38 +0200
From: Philipp Reisner <philipp.reisner@...bit.com>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Zhu Yanjun <yanjun.zhu@...ux.dev>, Leon Romanovsky <leon@...nel.org>, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2] rdma_rxe: call comp_handler without holding cq->cq_lock
Hi Jason,
On Wed, Sep 24, 2025 at 3:21 PM Jason Gunthorpe <jgg@...dia.com> wrote:
> On Fri, Aug 22, 2025 at 10:19:41AM +0200, Philipp Reisner wrote:
> > Allow the comp_handler callback implementation to call ib_poll_cq().
> > A call to ib_poll_cq() calls rxe_poll_cq() with the rdma_rxe driver.
> > And rxe_poll_cq() locks cq->cq_lock. That leads to a spinlock deadlock.
> >
> > The Mellanox and Intel drivers allow a comp_handler callback
> > implementation to call ib_poll_cq().
> >
> > Avoid the deadlock by calling the comp_handler callback without
> > holding cq->cq_lock.
>
> I spent some time looking at this, and I think the basic statement
> above is right. The comp_handler should be able to call poll_cq/etc
>
> rxe holding a lock it used to push a CQE is not correct.
>
> However! The comp_handler is also supposed to be single threaded by
> the driver, I don't think ULPs are prepared to handle concurrent calls
> to comp_handler.
>
> Other HW drivers run their comp_handlers from an EQ which is both
> single threaded and does not exclude poll_cq/etc.
>
> So while removing the cq lock here is correct from the perspective of
> allowing poll_cq, I could not find any locking in rxe that made
> do_complete() be single threaded.
>
> Please send a v2, either explain how the do_complete is single
> threaded in a comment above the comp_handler call, or make it be
> single threaded.
>
Thanks for following up. Sure, I will send a new version of it, it will
be v3, as this is already the discussion on v2.
Best regards,
Philipp
Powered by blists - more mailing lists