From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1CEBE468E4 for ; Thu, 12 Jun 2025 23:10:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 18C8142E0C; Thu, 12 Jun 2025 23:10:15 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id B775342E0C for ; Thu, 12 Jun 2025 23:10:14 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3a53359dea5so930125f8f.0 for ; Thu, 12 Jun 2025 14:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749762614; x=1750367414; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=smlXulxUtOYFqy3TgTnZfzv4Vla6aXkHeqtq+HSGdiA=; b=crmbXZlb9gQ+VdgWdeDp9DPplUJ2yyrQwu0T9VbI+JDgM208tPr7qthtgFUKO87oFa 2zs/CPBtWbBeeaYif9Ag8bgV0mdH1/F9QejzT9jt1Yo0XtQGzIF32ODVP79LuVjiaMBH Ot7VTHVEXwPsTTtTEUfRZBQrEWDIqpglR/P1e/Z1GUUnAlfB93ORYvUxk066S4ocZTtq opq7RhDjL4eT8pwACF3CftQ/QLwr5aSkbtNAxoCseFTGrAa2PuTI2sMl2P6+TuFm1+Up uqucIdzmnAbbYV/FA8svQyuDCULauEhX8ltO9fJ3UTIn1K8NYUXAFD2cOUNLRv/WwKEh ZgTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749762614; x=1750367414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=smlXulxUtOYFqy3TgTnZfzv4Vla6aXkHeqtq+HSGdiA=; b=LqVI2fmOATbHhqnTyuEG43BAoEiTYETPxaAqcUQW9vZUCnjUjlqo1qNt/fo2pH2Jmr U6MBQeaCqnntroRu3FpqU/G3+cjsA6FX+ZIBO8ou5ZMDZipywifuer4f54UkeFZ/ttCf Ov5GGi1jOXXE+c6+Gs7sjCGmXUhr3m5uxNDU7yXy5D9GYwGJVpVY0vaEojVTnhMGXcqb 9eJm2nlgOoWwKdak1lAwFRlcpyYJ/33urx4Ag7yXIGQSeh340zmBdz72cLSwvuCOcfvf jUa6a0UManAJg5rLRQEq/GXPhVo+BcjUKGz9FRD94EvWAHD+V9UuEYiVTfV/fNOFPItK 3QIg== X-Forwarded-Encrypted: i=1; AJvYcCWFeL9DcjhGrteDOVHLecb70JMQ+LCPaKV/Wtd2s7svrItwmkJLJyLWJOUS7DFZxoYPC8zCYv8=@dpdk.org X-Gm-Message-State: AOJu0YyRqskzhQGlPLdR/rK9KAbo6ndZk7Lr32t83VS4U5uCcTl7Zc6V PybfaQ48Bz433Pahr08dlJXVIZJuiM+4Dv38CjuIWt3+zOLswh57MkORSp6H5vU8 X-Gm-Gg: ASbGnculhNFpTu7Po1owvWByviWvaB5B150A20kfILAE7AD72cOwzhBXyiHaO1I9VHQ pG3ZFti3TW+tm52OYO0uHil7lbeIlNapGdSStPLuWY42+T/skXsZ8HWQHZlV3mr76z/sR7LCfey zawos7fNP4cW+b4TPJNhbdPcdM6UOQxUHjX/WnInxXfNLNht65i4Oj1IfJx2GBjFcAh4aBhorsA XJIKfpWIhMDrO+CB4Xv+nM6zi3cqr3An8E2u3itnqINhOAFXS4bvjORo6V+GezUlkwRq2Dod0Kh yfL3Wc8yOtoXawtq2KqbGf/YdwTglYnu0877KO4B63ji8HIpFfje+h7xtTSjhvvAxxNZ X-Google-Smtp-Source: AGHT+IHfy5y4sGqFNE+7T+VlmBXVq+Iu0EAQ6xQkcvkDf1KDdkZ9jGUgyDz4xbIksKU5PlppuyTKJw== X-Received: by 2002:a05:6000:1785:b0:3a4:ca73:75e3 with SMTP id ffacd0b85a97d-3a5686e9dd5mr545043f8f.12.1749762614256; Thu, 12 Jun 2025 14:10:14 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:f2df:571a:ae4c:bef2]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3a568b4c969sm351767f8f.85.2025.06.12.14.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jun 2025 14:10:13 -0700 (PDT) From: luca.boccassi@gmail.com To: Dengdui Huang Cc: Dmitry Kozlyuk , Anatoly Burakov , dpdk stable Subject: patch 'mem: fix lockup on address space shortage' has been queued to stable release 22.11.9 Date: Thu, 12 Jun 2025 22:07:03 +0100 Message-ID: <20250612210733.2506558-46-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250612210733.2506558-1-luca.boccassi@gmail.com> References: <20250612210733.2506558-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.9 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/14/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/d1423b3880669f8817741d02362796831d8f02c8 Thanks. Luca Boccassi --- >From d1423b3880669f8817741d02362796831d8f02c8 Mon Sep 17 00:00:00 2001 From: Dengdui Huang Date: Thu, 3 Apr 2025 10:57:36 +0800 Subject: [PATCH] mem: fix lockup on address space shortage [ 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 Acked-by: Dmitry Kozlyuk Acked-by: Anatoly Burakov --- 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 da6711d129..dab4f4cde1 100644 --- a/lib/eal/common/eal_common_memory.c +++ b/lib/eal/common/eal_common_memory.c @@ -99,8 +99,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.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-12 22:06:25.576283738 +0100 +++ 0046-mem-fix-lockup-on-address-space-shortage.patch 2025-06-12 22:06:23.874044722 +0100 @@ -1 +1 @@ -From 6643d1cad3b8a90a0e5ec4a4afa0d9f61dc5b34e Mon Sep 17 00:00:00 2001 +From d1423b3880669f8817741d02362796831d8f02c8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6643d1cad3b8a90a0e5ec4a4afa0d9f61dc5b34e ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index a2f64408f4..bfa36b8268 100644 +index da6711d129..dab4f4cde1 100644 @@ -25 +26 @@ -@@ -102,8 +102,12 @@ eal_get_virtual_area(void *requested_addr, size_t *size, +@@ -99,8 +99,12 @@ eal_get_virtual_area(void *requested_addr, size_t *size,