From 7e4d9504904f6e1ab9ea5bc2dfd1366c08483162 Mon Sep 17 00:00:00 2001 From: Michael Margolin Date: Thu, 17 Sep 2026 10:51:01 +0000 Subject: [PATCH] RDMA/efa: Use __GFP_RETRY_MAYFAIL for ring allocations 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. Link: https://patch.msgid.link/r/20260917105101.9365-1-mrgolin@amazon.com Reviewed-by: Firas Jahjah Reviewed-by: Yonatan Nachum Signed-off-by: Michael Margolin Signed-off-by: Jason Gunthorpe --- 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 9e4435401a4c..d56eb132545b 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; -- knotmirror 0.0.1