patch 'mem: fix lockup on address space shortage' has been queued to stable release 23.11.5

Xueming Li xuemingl at nvidia.com
Thu Jun 26 14:01:15 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/28/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e4963bf825ca86b4c429e50fcee8df590a55da6c

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From e4963bf825ca86b4c429e50fcee8df590a55da6c Mon Sep 17 00:00:00 2001
From: Dengdui Huang <huangdengdui at huawei.com>
Date: Thu, 3 Apr 2025 10:57:36 +0800
Subject: [PATCH] mem: fix lockup on address space shortage
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6643d1cad3b8a90a0e5ec4a4afa0d9f61dc5b34e ]

When the process address space is insufficient, mmap will fail,
which will cause an infinite loop.
This patch stops attempting mmap if it fails and
the requested size cannot be reduced.

Fixes: b7cc54187ea4 ("mem: move virtual area function in common directory")

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
 lib/eal/common/eal_common_memory.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/eal/common/eal_common_memory.c b/lib/eal/common/eal_common_memory.c
index d9433db623..e4ea05c46e 100644
--- a/lib/eal/common/eal_common_memory.c
+++ b/lib/eal/common/eal_common_memory.c
@@ -101,8 +101,12 @@ eal_get_virtual_area(void *requested_addr, size_t *size,
 
 		mapped_addr = eal_mem_reserve(
 			requested_addr, (size_t)map_sz, reserve_flags);
-		if ((mapped_addr == NULL) && allow_shrink)
-			*size -= page_sz;
+		if (mapped_addr == NULL) {
+			if (allow_shrink)
+				*size -= page_sz;
+			else
+				break;
+		}
 
 		if ((mapped_addr != NULL) && addr_is_hint &&
 				(mapped_addr != requested_addr)) {
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-26 19:59:19.926829938 +0800
+++ 0055-mem-fix-lockup-on-address-space-shortage.patch	2025-06-26 19:59:17.430418042 +0800
@@ -1 +1 @@
-From 6643d1cad3b8a90a0e5ec4a4afa0d9f61dc5b34e Mon Sep 17 00:00:00 2001
+From e4963bf825ca86b4c429e50fcee8df590a55da6c Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6643d1cad3b8a90a0e5ec4a4afa0d9f61dc5b34e ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +24 @@
-index a2f64408f4..bfa36b8268 100644
+index d9433db623..e4ea05c46e 100644
@@ -25 +27 @@
-@@ -102,8 +102,12 @@ eal_get_virtual_area(void *requested_addr, size_t *size,
+@@ -101,8 +101,12 @@ eal_get_virtual_area(void *requested_addr, size_t *size,


More information about the stable mailing list