linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Yamin Friedman <yaminf@mellanox.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>,
	Sagi Grimberg <sagi@grimberg.me>, Christoph Hellwig <hch@lst.de>,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH 2/4] RDMA/core: Introduce shared CQ pool API
Date: Mon, 11 May 2020 19:39:12 +0300	[thread overview]
Message-ID: <20200511163912.GD356445@unreal> (raw)
In-Reply-To: <345890f8-52d6-1aef-dd63-b3115384def5@mellanox.com>

On Mon, May 11, 2020 at 03:08:45PM +0300, Yamin Friedman wrote:
>
> On 5/11/2020 8:07 AM, Leon Romanovsky wrote:
> > On Sun, May 10, 2020 at 05:55:55PM +0300, Yamin Friedman wrote:
> > > Allow a ULP to ask the core to provide a completion queue based on a
> > > least-used search on a per-device CQ pools. The device CQ pools grow in a
> > > lazy fashion when more CQs are requested.

<...>

> > > +	while (!found) {
> > > +		spin_lock_irqsave(&dev->cq_pools_lock, flags);
> > > +		list_for_each_entry(cq, &dev->cq_pools[poll_ctx - 1],
> > > +				    pool_entry) {
> > > +			if (vector != cq->comp_vector)
> > > +				continue;
> > > +			if (cq->cqe_used + nr_cqe > cq->cqe)
> > > +				continue;
> > > +			if (found && cq->cqe_used >= found->cqe_used)
> > > +				continue;
> > > +			found = cq;
> > Don't you need to break from this loop at some point of time?
> In order to find the emptiest cq it loops over the entire list. If you think
> it is better just to find the first one with enough space I will break once
> one is found.

Does it matter to find emptiest CQ as long as you find one with enough cqe?
If yes, please document it, if no, this loop can be simplified.

Thanks

  reply	other threads:[~2020-05-11 16:39 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-10 14:55 [PATCH 0/4] Introducing RDMA shared CQ pool Yamin Friedman
2020-05-10 14:55 ` [PATCH 1/4] infiniband/core: Add protection for shared CQs used by ULPs Yamin Friedman
2020-05-11  4:37   ` Leon Romanovsky
2020-05-11  8:39     ` Sagi Grimberg
2020-05-11 11:52       ` Yamin Friedman
2020-05-11 11:59     ` Yamin Friedman
2020-05-11 16:45       ` Leon Romanovsky
2020-05-10 14:55 ` [PATCH 2/4] RDMA/core: Introduce shared CQ pool API Yamin Friedman
2020-05-11  5:07   ` Leon Romanovsky
2020-05-11 12:08     ` Yamin Friedman
2020-05-11 16:39       ` Leon Romanovsky [this message]
2020-05-12  7:00       ` Yamin Friedman
2020-05-12  8:08         ` Leon Romanovsky
2020-05-11  8:49   ` Sagi Grimberg
2020-05-11 12:03     ` Yamin Friedman
2020-05-12  6:55       ` Sagi Grimberg
2020-05-12  8:40         ` Yamin Friedman
2020-05-12  3:08   ` [RDMA/core] 7b491b3fb2: BUG:kernel_hang_in_test_stage kernel test robot
2020-05-10 14:55 ` [PATCH 3/4] nvme-rdma: use new shared CQ mechanism Yamin Friedman
2020-05-11  8:50   ` Sagi Grimberg
2020-05-11 16:29   ` Max Gurtovoy
2020-05-10 14:55 ` [PATCH 4/4] nvmet-rdma: " Yamin Friedman
2020-05-11  8:50   ` Sagi Grimberg
2020-05-10 15:04 ` [PATCH 0/4] Introducing RDMA shared CQ pool Gal Pressman
2020-05-10 15:17   ` Yamin Friedman
2020-05-11  8:34 ` Sagi Grimberg
2020-05-11 12:24   ` Yamin Friedman

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=20200511163912.GD356445@unreal \
    --to=leon@kernel.org \
    --cc=hch@lst.de \
    --cc=jgg@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sagi@grimberg.me \
    --cc=yaminf@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).