All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@mellanox.com>
To: Yishai Hadas <yishaih@dev.mellanox.co.il>
Cc: Andrew Boyer <aboyer@pensando.io>,
	Yishai Hadas <yishaih@mellanox.com>,
	Leon Romanovsky <leonro@mellanox.com>,
	linux-rdma@vger.kernel.org, maorg@mellanox.com
Subject: Re: Lockless behavior for CQs in userspace
Date: Wed, 18 Mar 2020 09:45:58 -0300	[thread overview]
Message-ID: <20200318124558.GH13183@mellanox.com> (raw)
In-Reply-To: <49d65148-8915-9a61-383f-1919e0594a8c@dev.mellanox.co.il>

On Wed, Mar 18, 2020 at 02:36:35PM +0200, Yishai Hadas wrote:
> On 3/18/2020 1:43 PM, Jason Gunthorpe wrote:
> > On Wed, Mar 18, 2020 at 09:52:27AM +0200, Yishai Hadas wrote:
> > 
> > > We can really consider extending the functionality of a parent domain that
> > > was just added for CQ in case it holds a thread domain for this purpose.
> > > However, current code enforces creating a dedicated BF as part of thread
> > > domain unless we extend ibv_alloc_td() to ask only for marking the single
> > > thread functionality.
> > 
> > Doesn't the CQ need a BF too?
> 
> Not really, it uses a per-allocated device one for writing 8 bytes for
> doorbell, applicable only in the arm/events mode.

But this also wastes a BF, if the app is only running a single
lockless TD then the CQ could use the BF from the TD, shared with the
QP and not allocate another one

> > > The existing alternative is or to use the legacy ENV that mentioned above or
> > > to use the ibv_cq_ex functionality which upon its creation gets an explicit
> > > flag for single threaded one (i.e. IBV_CREATE_CQ_ATTR_SINGLE_THREADED).
> > 
> > An apps that don't want the BF can always use
> > IBV_CREATE_CQ_ATTR_SINGLE_THREADED
> > 
> 
> This requires moving to the new polling mechanism where this option is
> really applicable (see a3a31e8dc6a3fbf577dd8b12742d0c70cf63bd29).

cq_ex is pollable the normal way if converted with ibv_cq_ex_to_cq()

It is also a bug if the old env driven lock elimination doesn't trigger
for normal CQ poll if IBV_CREATE_CQ_ATTR_SINGLE_THREADED is specified.

Jason

      reply	other threads:[~2020-03-18 12:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-17 14:45 Lockless behavior for CQs in userspace Andrew Boyer
2020-03-17 15:00 ` Leon Romanovsky
2020-03-17 15:10   ` Andrew Boyer
2020-03-17 19:51     ` Jason Gunthorpe
2020-03-18  7:52       ` Yishai Hadas
2020-03-18  8:03         ` Leon Romanovsky
2020-03-18  8:15           ` Yishai Hadas
2020-03-18 11:43         ` Jason Gunthorpe
2020-03-18 12:36           ` Yishai Hadas
2020-03-18 12:45             ` Jason Gunthorpe [this message]

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=20200318124558.GH13183@mellanox.com \
    --to=jgg@mellanox.com \
    --cc=aboyer@pensando.io \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@mellanox.com \
    --cc=yishaih@dev.mellanox.co.il \
    --cc=yishaih@mellanox.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.