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 5C5954569C for ; Wed, 24 Jul 2024 13:35:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 560F442D89; Wed, 24 Jul 2024 13:35:03 +0200 (CEST) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id 0919542D28 for ; Wed, 24 Jul 2024 13:35:02 +0200 (CEST) Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-3683178b226so3582486f8f.1 for ; Wed, 24 Jul 2024 04:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721820901; x=1722425701; 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=aC4WdezcelURwnslDbvqIVyiSfUOTJ9vqO8YVo7PEZA=; b=TXx5wwW0i9UDK0t1w8tZV4BVV63WG15/dJnFP91YC811LVL39tklA9uXrbgnLuHD6i 3ftWUH84euCFvgyipdTUZ1HIrmo1t2mZOHc7f+mHHyfNk0QHPXPZf6Yox2FXfkfsDvGM kU8TXTzDHJLzCQp2djYooHJhYUS2TX2O8PKEqICdlWAWDK7iCU1iGH7IQG+bKHYuHWbN jpYw8L3c26aMV09rqcCcd7Y3fSMhnjgzvHLk0eUicp8qvYhmV3LGjsy5coL4qyGiqAO5 D9VxanGec+HZDEggClkihr9xhqFMZrOeXqPZYEtJtygpPd2vqmh7UeShUnwJuyb4rkMn Kf2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721820901; x=1722425701; 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=aC4WdezcelURwnslDbvqIVyiSfUOTJ9vqO8YVo7PEZA=; b=ROD/SBIPfPsFz/uRaV4f1MkbEieuGrDMQh+t79lK1LRlaaODYXQkZ9/BldWhOJHIT3 oSX9cv+ZkjVA4yLutQCOcv5siiGK8hObfcVFgpGemYhZfY4UzcNxfPrvDPKyKn3oLnK1 ZpjaC6ogu9TfZQXP9/mYpyL7hfyi1jLAlSuZnxDttBGZeospcd1ZsQmGV2R1qSUK6wB8 ZAxb1bV0pKfMrpCXubs31dTVb7HBCnucDTdn4O6yt304+iVJhRs64fx1TqMLqOqrhqjK QyxEgNphyHA5ZE9nqhakz/CAxu6VzfmNEklSlUTEB26MysvKATJEkvz5dTVOWMzvqgOf OxWA== X-Gm-Message-State: AOJu0Yz0PpbfPtYK7h7YoiWEYzejU2D0P+y2k/JUXuQ4ETncX5EkfH1Q 1eGetY2Z+GyiCIIFtsVP+724BIICvMOqGGurJkLKYkaEFzZgzwmoYWe4CRtL X-Google-Smtp-Source: AGHT+IEQsKFhcE1OyN5wdpncynY/16VAYF9a46qJS9biYyAO3+rScC85qBe6BFRvMA87k+bYduE4Kg== X-Received: by 2002:a5d:6d05:0:b0:368:71bc:2b08 with SMTP id ffacd0b85a97d-369f09a20a3mr2019443f8f.3.1721820901556; Wed, 24 Jul 2024 04:35:01 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427f935933csm25816645e9.7.2024.07.24.04.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:35:01 -0700 (PDT) From: luca.boccassi@gmail.com To: Anatoly Burakov Cc: dpdk stable Subject: patch 'malloc: fix multi-process wait condition handling' has been queued to stable release 22.11.6 Date: Wed, 24 Jul 2024 12:33:09 +0100 Message-Id: <20240724113318.616754-31-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240724113318.616754-1-luca.boccassi@gmail.com> References: <20240715152704.2229503-86-luca.boccassi@gmail.com> <20240724113318.616754-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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/24. 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/0a15aefcc66b8acf00c931f1d5c61a77caabe5ea coverity's Thanks. Luca Boccassi --- >From 0a15aefcc66b8acf00c931f1d5c61a77caabe5ea Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Fri, 12 Jul 2024 12:41:35 +0100 Subject: [PATCH] malloc: fix multi-process wait condition handling [ upstream commit 429219adab185909a8127e680d19f7628af62fb2 ] >From coverity's point of view, it is theoretically possible to have an infinite wait on a wait condition because while we do check for timeout, we do not check for whether the event we are waiting for has already occurred by the time we get to the first cond_wait call (in this case, it's state of memory request list entry's state being set to COMPLETE). This can't really happen as the only time a wait condition is triggered is when we are receiving a memory event (so the entry we are waiting on cannot change before wait condition is triggered because it's protected by a mutex), so either we receive an event and modify entry state, or we exit wait on a timeout and do not care about request state. However, it's better to keep coverity happy. Coverity issue: 425709 Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug") Signed-off-by: Anatoly Burakov --- lib/eal/common/malloc_mp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/malloc_mp.c b/lib/eal/common/malloc_mp.c index 7270c2ec90..c95c4635d1 100644 --- a/lib/eal/common/malloc_mp.c +++ b/lib/eal/common/malloc_mp.c @@ -755,7 +755,8 @@ request_to_primary(struct malloc_mp_req *user_req) do { ret = pthread_cond_timedwait(&entry->cond, &mp_request_list.lock, &ts); - } while (ret != 0 && ret != ETIMEDOUT); + } while ((ret != 0 && ret != ETIMEDOUT) && + entry->state == REQ_STATE_ACTIVE); if (entry->state != REQ_STATE_COMPLETE) { RTE_LOG(ERR, EAL, "Request timed out\n"); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-24 12:29:23.013749866 +0100 +++ 0031-malloc-fix-multi-process-wait-condition-handling.patch 2024-07-24 12:29:20.803026775 +0100 @@ -1 +1 @@ -From 429219adab185909a8127e680d19f7628af62fb2 Mon Sep 17 00:00:00 2001 +From 0a15aefcc66b8acf00c931f1d5c61a77caabe5ea Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 429219adab185909a8127e680d19f7628af62fb2 ] + @@ -21 +22,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index 2d39b0716f..9765277f5d 100644 +index 7270c2ec90..c95c4635d1 100644 @@ -32 +33 @@ -@@ -756,7 +756,8 @@ request_to_primary(struct malloc_mp_req *user_req) +@@ -755,7 +755,8 @@ request_to_primary(struct malloc_mp_req *user_req) @@ -41 +42 @@ - EAL_LOG(ERR, "Request timed out"); + RTE_LOG(ERR, EAL, "Request timed out\n");