All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Edward Srouji <edwards@nvidia.com>,
	linux-rdma@vger.kernel.org,
	Michael Guralnik <michaelgur@nvidia.com>,
	netdev@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Subject: [PATCH rdma-next 0/4] Optimize DMABUF mkey page size in mlx5
Date: Wed,  9 Jul 2025 09:42:07 +0300	[thread overview]
Message-ID: <cover.1751979184.git.leon@kernel.org> (raw)

From Edward:

This patch series enables the mlx5 driver to dynamically choose the
optimal page size for a DMABUF-based memory key (mkey), rather than
always registering with a fixed page size.

Previously, DMABUF memory registration used a fixed 4K page size for
mkeys which could lead to suboptimal performance when the underlying
memory layout may offer better page sizes.

This approach did not take advantage of larger page size capabilities
advertised by the HCA, and the driver was not setting the proper page
size mask in the mkey mask when performing page size changes, potentially
leading to invalid registrations when updating to a very large pages.

This series improves DMABUF performance by dynamically selecting the
best page size for a given memory region (MR) both at creation time and
on page fault occurrences, based on the underlying layout and fixing
related gaps and bugs.

By doing so, we reduce the number of page table entries (and thus MTT/
KSM descriptors) that the HCA must traverse, which in turn reduces
cache-line fetches.

Thanks

Edward Srouji (2):
  RDMA/mlx5: Fix UMR modifying of mkey page size
  RDMA/mlx5: Optimize DMABUF mkey page size

Michael Guralnik (2):
  net/mlx5: Expose HCA capability bits for mkey max page size
  RDMA/mlx5: Align mkc page size capability check to PRM

 drivers/infiniband/hw/mlx5/mlx5_ib.h |  77 +++++--
 drivers/infiniband/hw/mlx5/mr.c      |  10 +-
 drivers/infiniband/hw/mlx5/odp.c     |  31 ++-
 drivers/infiniband/hw/mlx5/umr.c     | 306 ++++++++++++++++++++++++---
 drivers/infiniband/hw/mlx5/umr.h     |  13 +-
 include/linux/mlx5/device.h          |   1 +
 include/linux/mlx5/mlx5_ifc.h        |   4 +-
 7 files changed, 387 insertions(+), 55 deletions(-)

-- 
2.50.0


             reply	other threads:[~2025-07-09  6:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09  6:42 Leon Romanovsky [this message]
2025-07-09  6:42 ` [PATCH mlx5-next 1/4] net/mlx5: Expose HCA capability bits for mkey max page size Leon Romanovsky
2025-07-09  6:42 ` [PATCH mlx5-next 2/4] RDMA/mlx5: Fix UMR modifying of mkey " Leon Romanovsky
2025-07-09  6:42 ` [PATCH rdma-next 3/4] RDMA/mlx5: Align mkc page size capability check to PRM Leon Romanovsky
2025-07-09  6:42 ` [PATCH rdma-next 4/4] RDMA/mlx5: Optimize DMABUF mkey page size Leon Romanovsky
2025-07-13  7:14 ` (subset) [PATCH rdma-next 0/4] Optimize DMABUF mkey page size in mlx5 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=cover.1751979184.git.leon@kernel.org \
    --to=leon@kernel.org \
    --cc=edwards@nvidia.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=michaelgur@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@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.