]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/mlx5: Replace cache list with Xarray
authorAharon Landau <aharonl@nvidia.com>
Tue, 26 Jul 2022 07:19:08 +0000 (10:19 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 27 Jul 2022 17:45:48 +0000 (14:45 -0300)
commita2db5c6350b63b137fc085f8a2cf6b01ca4baf98
treee9ba1f9ea7fe6385d947d98e8ccd6954d8ad035e
parent588ad37ce1b282f8d361cadf22a58306ca9eea06
RDMA/mlx5: Replace cache list with Xarray

The Xarray allows us to store the cached mkeys in memory efficient way.

Entries are reserved in the Xarray using xa_cmpxchg before calling to the
upcoming callbacks to avoid allocations in interrupt context.  The
xa_cmpxchg can sleep when using GFP_KERNEL, so we call it in a loop to
ensure one reserved entry for each process trying to reserve.

Link: https://lore.kernel.org/r/20220726071911.122765-3-michaelgur@nvidia.com
Signed-off-by: Aharon Landau <aharonl@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/mr.c