public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Shay Drory <shayd@nvidia.com>, linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next] RDMA/mlx5: Implement mkeys management via LIFO queue
Date: Wed, 20 Sep 2023 13:36:37 -0300	[thread overview]
Message-ID: <20230920163637.GE13733@nvidia.com> (raw)
In-Reply-To: <96049c4bd3346a98240483ed2d22c5b1c7155c8a.1695203535.git.leon@kernel.org>

On Wed, Sep 20, 2023 at 12:54:56PM +0300, Leon Romanovsky wrote:
> From: Shay Drory <shayd@nvidia.com>
> 
> Currently, mkeys are managed via xarray. This implementation leads to
> a degradation in cases many MRs are unregistered in parallel, due to xarray
> internal implementation, for example: deregistration 1M MRs via 64 threads
> is taking ~15% more time[1].
> 
> Hence, implement mkeys management via LIFO queue, which solved the
> degradation.
> 
> [1]
> 2.8us in kernel v5.19 compare to 3.2us in kernel v6.4
> 
> Signed-off-by: Shay Drory <shayd@nvidia.com>
> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/mlx5_ib.h |  19 +-
>  drivers/infiniband/hw/mlx5/mr.c      | 324 ++++++++++++---------------
>  drivers/infiniband/hw/mlx5/umr.c     |   4 +-
>  3 files changed, 167 insertions(+), 180 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> index 16713baf0d06..261c86fe6433 100644
> --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
> +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> @@ -753,10 +753,23 @@ struct umr_common {
>  	unsigned int state;
>  };
>  
> +#define NUM_MKEYS_PER_PAGE (PAGE_SIZE / sizeof(u32))
> +
> +struct mlx5_mkeys_page {
> +	u32 mkeys[NUM_MKEYS_PER_PAGE];
> +	struct list_head list;
> +};

Er, isn't the point of this to be PAGE_SIZE big?

Add an

static_assert(sizeof(struct mlx5_mkeys_page) == PAGE_SIZE)

And fix it so it is true..

Jason

  reply	other threads:[~2023-09-20 16:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  9:54 [PATCH rdma-next] RDMA/mlx5: Implement mkeys management via LIFO queue Leon Romanovsky
2023-09-20 16:36 ` Jason Gunthorpe [this message]
2023-09-21  6:43   ` Leon Romanovsky

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=20230920163637.GE13733@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=shayd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox