Commit 86457a9
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>1 parent 17ae355 commit 86457a9
2 files changed
Lines changed: 152 additions & 88 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
651 | 651 | | |
652 | 652 | | |
653 | 653 | | |
654 | | - | |
655 | | - | |
656 | 654 | | |
657 | 655 | | |
658 | 656 | | |
| |||
744 | 742 | | |
745 | 743 | | |
746 | 744 | | |
747 | | - | |
| 745 | + | |
| 746 | + | |
748 | 747 | | |
749 | 748 | | |
750 | 749 | | |
| |||
756 | 755 | | |
757 | 756 | | |
758 | 757 | | |
759 | | - | |
760 | | - | |
761 | | - | |
| 758 | + | |
762 | 759 | | |
763 | | - | |
| 760 | + | |
764 | 761 | | |
765 | | - | |
766 | 762 | | |
767 | 763 | | |
768 | | - | |
769 | 764 | | |
770 | | - | |
771 | 765 | | |
772 | 766 | | |
773 | 767 | | |
| |||
0 commit comments