IB/mlx5: Reduce max order of memory allocated for xlt update
authorPraveen Kumar Kannoju <praveen.kannoju@oracle.com>
Sat, 3 Apr 2021 04:53:55 +0000 (04:53 +0000)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 7 Apr 2021 23:25:17 +0000 (20:25 -0300)
commit7e111bbff92620f56609a81353bba5bd1944851b
tree4ae135190e0f15f0192714f93282a7bb6d8e6370
parentfdde1aa09a82992cb09af8082d50afae5d22bfa4
IB/mlx5: Reduce max order of memory allocated for xlt update

To update xlt (during mlx5_ib_reg_user_mr()), the driver can request up to
1 MB (order-8) memory, depending on the size of the MR. This costly
allocation can sometimes take very long to return (a few seconds). This
causes the calling application to hang for a long time, especially when
the system is fragmented.  To avoid these long latency spikes, the calls
the higher order allocations need to fail faster in case they are not
available.

In order to acheive this we need __GFP_NORETRY flag in the gfp_mask before
during fetching the free pages. Allow the algorithm to automatically fall
back to smaller page sizes.

Link: https://lore.kernel.org/r/1617425635-35631-1-git-send-email-praveen.kannoju@oracle.com
Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com>
Acked-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mlx5/mr.c