All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Pearson <rpearsonhpe@gmail.com>
To: Bernard Metzler <BMT@zurich.ibm.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Zhu Yanjun <zyjzyj2000@gmail.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>
Subject: Re: question about the completion tasklet in the rxe driver
Date: Thu, 16 Mar 2023 12:14:30 -0500	[thread overview]
Message-ID: <3d8576fc-eab5-c962-95bb-badadd18c85f@gmail.com> (raw)
In-Reply-To: <SA0PR15MB3919EAF4C949E82D2887C1AA99BC9@SA0PR15MB3919.namprd15.prod.outlook.com>

On 3/16/23 04:40, Bernard Metzler wrote:
> 
> 
>> -----Original Message-----
>> From: Bob Pearson <rpearsonhpe@gmail.com>
>> Sent: Wednesday, 15 March 2023 22:56
>> To: Jason Gunthorpe <jgg@nvidia.com>; Zhu Yanjun <zyjzyj2000@gmail.com>;
>> linux-rdma@vger.kernel.org; Bernard Metzler <BMT@zurich.ibm.com>
>> Subject: [EXTERNAL] question about the completion tasklet in the rxe driver
>>
>> I have a goal of trying to get rid of all the tasklets in the rxe driver
>> and with the replacement of the
>> three QP tasklets by workqueues the only remaining one is the tasklet that
>> defers the CQ completion
>> handler. This has been in there since the driver went upstream so the
>> history of why it is there is lost.
>>
>> I notice that the mlx5 driver does have a deferral mechanism for the
>> completion handler but the siw driver
>> does not. I really do not see what advantage, if any, this has for the rxe
>> driver. Perhaps there is some
>> reason it shouldn't run in hard interrupt context but the CQ tasklet is a
>> soft interrupt so the completion
>> handler can't sleep anyway.
>>
>> As an experiment I removed the CQ tasklet in the rxe driver and it runs
>> fine. In fact the performance is
>> slightly better with the completion handler called inline rather than
>> deferred to another tasklet.
> 
> That is what I would suggest to do. Why would you leave receive
> processing or failing send processing w/o creating the CQE and
> kicking the CQ handler, if you are in a context with
> all information available to build a CQE, signal its availability
> to the consumer and kick a user handler if registered and armed?
> 
> Only exception I see: If you process the SQ in post_send() user context
> and a failure results in immediate CQE creation, direct CQ handler calling
> is not allowed - see Documentation/infiniband/core_locking.rst
> Not sure though, if rxe allows for direct SQ processing out of user
> context.
> 
> Cheers,
> Bernard.

And you did. I am not sure why the mlx5 driver defers the completion handler call
to a tasklet. I could be that it gets called in a hard interrupt and completion
handling is deferred to a soft interrupt context. But for rxe the completion
is always already in a soft interrupt context or a process context.

Bob

> 
>> If we can eliminate this there won't be anymore tasklets in the rxe driver.
>>
>> Does anyone know why the tasklet was put in in the first place?
>>
>> Thanks,
>>
>> Bob


  reply	other threads:[~2023-03-16 17:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 21:56 question about the completion tasklet in the rxe driver Bob Pearson
2023-03-16  9:40 ` Bernard Metzler
2023-03-16 17:14   ` Bob Pearson [this message]
2023-03-16 18:18     ` Bernard Metzler
2023-03-21 12:54     ` Jason Gunthorpe
2023-03-19  9:02 ` Zhu Yanjun

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=3d8576fc-eab5-c962-95bb-badadd18c85f@gmail.com \
    --to=rpearsonhpe@gmail.com \
    --cc=BMT@zurich.ibm.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=zyjzyj2000@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.