linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] IB/mlx5: Reduce max order of memory allocated for xlt update
@ 2021-04-03  4:53 Praveen Kumar Kannoju
  2021-04-04 10:37 ` Leon Romanovsky
  2021-04-07 23:31 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Praveen Kumar Kannoju @ 2021-04-03  4:53 UTC (permalink / raw)
  To: leon, dledford, jgg, linux-rdma, linux-kernel
  Cc: rajesh.sivaramasubramaniom, rama.nichanamatlu, aruna.ramakrishna,
	jeffery.yoder, Praveen Kumar Kannoju

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. This patch adds this flag
to the mask.

Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com>
---
 drivers/infiniband/hw/mlx5/mr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
index db05b0e..429e7aa6 100644
--- a/drivers/infiniband/hw/mlx5/mr.c
+++ b/drivers/infiniband/hw/mlx5/mr.c
@@ -1028,7 +1028,7 @@ static void *mlx5_ib_alloc_xlt(size_t *nents, size_t ent_size, gfp_t gfp_mask)
 	 */
 	might_sleep();
 
-	gfp_mask |= __GFP_ZERO;
+	gfp_mask |= __GFP_ZERO | __GFP_NORETRY;
 
 	/*
 	 * If the system already has a suitable high order page then just use
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] IB/mlx5: Reduce max order of memory allocated for xlt update
  2021-04-03  4:53 [PATCH v3] IB/mlx5: Reduce max order of memory allocated for xlt update Praveen Kumar Kannoju
@ 2021-04-04 10:37 ` Leon Romanovsky
  2021-04-07 23:31 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2021-04-04 10:37 UTC (permalink / raw)
  To: Praveen Kumar Kannoju
  Cc: dledford, jgg, linux-rdma, linux-kernel,
	rajesh.sivaramasubramaniom, rama.nichanamatlu, aruna.ramakrishna,
	jeffery.yoder

On Sat, Apr 03, 2021 at 04:53:55AM +0000, Praveen Kumar Kannoju wrote:
> 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. This patch adds this flag
> to the mask.
> 
> Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com>
> ---
>  drivers/infiniband/hw/mlx5/mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks a lot,
Acked-by: Leon Romanovsky <leonro@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] IB/mlx5: Reduce max order of memory allocated for xlt update
  2021-04-03  4:53 [PATCH v3] IB/mlx5: Reduce max order of memory allocated for xlt update Praveen Kumar Kannoju
  2021-04-04 10:37 ` Leon Romanovsky
@ 2021-04-07 23:31 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-04-07 23:31 UTC (permalink / raw)
  To: Praveen Kumar Kannoju
  Cc: leon, dledford, linux-rdma, linux-kernel,
	rajesh.sivaramasubramaniom, rama.nichanamatlu, aruna.ramakrishna,
	jeffery.yoder

On Sat, Apr 03, 2021 at 04:53:55AM +0000, Praveen Kumar Kannoju wrote:
> 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. This patch adds this flag
> to the mask.
> 
> Signed-off-by: Praveen Kumar Kannoju <praveen.kannoju@oracle.com>
> Acked-by: Leon Romanovsky <leonro@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/mr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-07 23:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-03  4:53 [PATCH v3] IB/mlx5: Reduce max order of memory allocated for xlt update Praveen Kumar Kannoju
2021-04-04 10:37 ` Leon Romanovsky
2021-04-07 23:31 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).