All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Michael Guralnik <michaelgur@nvidia.com>
Cc: leonro@nvidia.com, linux-rdma@vger.kernel.org, maorg@nvidia.com,
	Aharon Landau <aharonl@nvidia.com>
Subject: Re: [PATCH v2 rdma-next 2/6] RDMA/mlx5: Remove explicit ODP cache entry
Date: Wed, 7 Dec 2022 20:22:58 -0400	[thread overview]
Message-ID: <Y5EuYu5HK+CAFGtO@nvidia.com> (raw)
In-Reply-To: <20221207085752.82458-3-michaelgur@nvidia.com>

On Wed, Dec 07, 2022 at 10:57:48AM +0200, Michael Guralnik wrote:
> From: Aharon Landau <aharonl@nvidia.com>
> 
> Explicit ODP mkey doesn't have unique properties. There is no need to
> devote to it a special entry. Removing it.
> 
> Signed-off-by: Aharon Landau <aharonl@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/odp.c | 19 ++++---------------
>  include/linux/mlx5/driver.h      |  1 -
>  2 files changed, 4 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
> index e9a29adef7dc..71b733fcac37 100644
> --- a/drivers/infiniband/hw/mlx5/odp.c
> +++ b/drivers/infiniband/hw/mlx5/odp.c
> @@ -406,6 +406,7 @@ static void mlx5_ib_page_fault_resume(struct mlx5_ib_dev *dev,
>  static struct mlx5_ib_mr *implicit_get_child_mr(struct mlx5_ib_mr *imr,
>  						unsigned long idx)
>  {
> +	int order = order_base_2(MLX5_IMR_MTT_ENTRIES);

unsigned int

>  	struct mlx5_ib_dev *dev = mr_to_mdev(imr);
>  	struct ib_umem_odp *odp;
>  	struct mlx5_ib_mr *mr;
> @@ -418,7 +419,7 @@ static struct mlx5_ib_mr *implicit_get_child_mr(struct mlx5_ib_mr *imr,
>  	if (IS_ERR(odp))
>  		return ERR_CAST(odp);
>  
> -	mr = mlx5_mr_cache_alloc(dev, &dev->cache.ent[MLX5_IMR_MTT_CACHE_ENTRY],
> +	mr = mlx5_mr_cache_alloc(dev, &dev->cache.ent[order],

Okay, I get it now, this is actually just order 18, so it is covered
by the existing order. You should clarify the commit message that it
is the same as the order 18 entry.

Also add a compile time assertion here:

static_assert(order < MKEY_CACHE_LAST_STD_ENTRY);

Jason

  parent reply	other threads:[~2022-12-08  0:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07  8:57 [PATCH v2 rdma-next 0/6] RDMA/mlx5: Switch MR cache to use RB-tree Michael Guralnik
2022-12-07  8:57 ` [PATCH v2 rdma-next 1/6] RDMA/mlx5: Don't keep umrable 'page_shift' in cache entries Michael Guralnik
2022-12-07  8:57 ` [PATCH v2 rdma-next 2/6] RDMA/mlx5: Remove explicit ODP cache entry Michael Guralnik
2022-12-08  0:02   ` Jason Gunthorpe
2022-12-08  0:22   ` Jason Gunthorpe [this message]
2022-12-07  8:57 ` [PATCH v2 rdma-next 3/6] RDMA/mlx5: Change the cache structure to RB-tree Michael Guralnik
2022-12-08  0:17   ` Jason Gunthorpe
2022-12-07  8:57 ` [PATCH v2 rdma-next 4/6] RDMA/mlx5: Introduce mlx5r_cache_rb_key Michael Guralnik
2022-12-08  0:39   ` Jason Gunthorpe
2022-12-13 12:12     ` Michael Guralnik
2022-12-07  8:57 ` [PATCH v2 rdma-next 5/6] RDMA/mlx5: Cache all user cacheable mkeys on dereg MR flow Michael Guralnik
2022-12-08  0:44   ` Jason Gunthorpe
2022-12-07  8:57 ` [PATCH v2 rdma-next 6/6] RDMA/mlx5: Add work to remove temporary entries from the cache Michael Guralnik

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=Y5EuYu5HK+CAFGtO@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=aharonl@nvidia.com \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=maorg@nvidia.com \
    --cc=michaelgur@nvidia.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.