Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/efa: Use __GFP_RETRY_MAYFAIL for ring allocations
@ 2026-09-17 10:51 Michael Margolin
  2026-09-17 10:58 ` sashiko-bot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Michael Margolin @ 2026-09-17 10:51 UTC (permalink / raw)
  To: jgg, leon, linux-rdma
  Cc: sleybo, matua, gal.pressman, Firas Jahjah, Yonatan Nachum

RQ and CQ ring buffers require physically contiguous memory. On
systems under memory pressure, high-order allocations can fail
even when sufficient free memory exists because the allocator
gives up after a single reclaim and compaction attempt for
costly-order requests that lack __GFP_RETRY_MAYFAIL.

Add __GFP_RETRY_MAYFAIL to the GFP flags in efa_zalloc_mapped()
to allow retries with escalating compaction priority and release
of highatomic reserves before giving up.

Reviewed-by: Firas Jahjah <firasj@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
---
 drivers/infiniband/hw/efa/efa_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 2d28d68efe77..0b0396e190f2 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -190,7 +190,7 @@ static void *efa_zalloc_mapped(struct efa_dev *dev, dma_addr_t *dma_addr,
 {
 	void *addr;
 
-	addr = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
+	addr = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO | __GFP_RETRY_MAYFAIL);
 	if (!addr)
 		return NULL;
 
-- 
2.47.3


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

end of thread, other threads:[~2026-09-28 18:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 10:51 [PATCH for-next] RDMA/efa: Use __GFP_RETRY_MAYFAIL for ring allocations Michael Margolin
2026-09-17 10:58 ` sashiko-bot
2026-09-23 10:51 ` Leon Romanovsky
2026-09-23 11:57   ` Jason Gunthorpe
2026-09-23 13:58     ` Michael Margolin
2026-09-28 18:27 ` Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox