Skip to content

Optimize DMABUF mkey page size in mlx5

Leon Romanovsky linux-rdma netdev 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4net/mlx5: Expose HCA capability bits for mkey max page sizeinclude/linux/mlx5/mlx5_ifc.h+3 -10 replies
2/4RDMA/mlx5: Fix UMR modifying of mkey page sizedrivers/infiniband/hw/mlx5/umr.c include/linux/mlx5/device.h+5 -20 replies
3/4RDMA/mlx5: Align mkc page size capability check to PRMdrivers/infiniband/hw/mlx5/mlx5_ib.h drivers/infiniband/hw/mlx5/mr.c+52 -90 replies
4/4RDMA/mlx5: Optimize DMABUF mkey page sizedrivers/infiniband/hw/mlx5/mlx5_ib.h drivers/infiniband/hw/mlx5/odp.c drivers/infiniband/hw/mlx5/umr.c +1 more+327 -430 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchMichael Guralnik
1/4
2/4R-b
3/4
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH rdma-next 0/4] Optimize DMABUF mkey page size in mlx5

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(-)
Signature · 1 line
2.50.0