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 A8958A0544; Mon, 10 Oct 2022 01:53:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C89F400D5; Mon, 10 Oct 2022 01:53:27 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id E432640042; Mon, 10 Oct 2022 01:53:25 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 504FF5C00F8; Sun, 9 Oct 2022 19:53:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 09 Oct 2022 19:53:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1665359605; x= 1665446005; bh=nI0SWAOxztL6PSlSURPIaiBTpWZYQjoW60Fi2sdUMiU=; b=E D9SiRVfCNcalUaJ3kOUfdJjzucr040QfXH6u8uvEy3TNrj5IHJfk9ZD1rDYH6a07 KYeMVM3PFvkTm6k5MjbFcg0OozwuNgUOsjrJIYEWpKQ09a6qLhRkty/1el+LB4zH 1OmoAmyhMG3pLgCB2A09ZdFc45iOPjmn66IJmV11UjemJzEfQ8e22G8EPGdbmT4D /ydB4LIyacNyYy/9GztIDr1l7jJKC+8cW8/SZqjUC1zS+zTYzdGRZsE4Z+5pJbs6 u9hfVxs5TfZZ89mfmg3Uitx15lZUpjSfdKJM7JUMG0yY6ARMWgpABoIzsICzURwD 08j4z20wCtQMeBMCCaa4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1665359605; x= 1665446005; bh=nI0SWAOxztL6PSlSURPIaiBTpWZYQjoW60Fi2sdUMiU=; b=U g5pgX/F+gZ/Yz5VOUCZg9xgCQe8KUshWrUs5govqQnxhXLZZ5jEzaDJo0/j/u4DH j4JDVkz+dEb3NNGbnwBgwTeE7f3gx40S4o61EwjDLVVpLfHrBeTzjr/XN8L3AaiX 3TdRj+oFEFJ3ZF9f839WfPyg1E7H2Qb+GAXzUM+CPFtuPK0wf+uuSAMj4ylSeWqJ 0wGxwtl23ymFZrd3zrS1DR+aCXCJa7JVliG5Tp4SUTQ2HogBmrMT00tTvYKAvDkT o6CtFoUUj1DvGB6cP7P9uOOUhUglWjEu0K62m46wNa4JBK5k5N23B22UwGv4eG+T GlB+sj/LOz1Hjz25bQDMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejvddgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpeffjedtvdfhuddugeeluedtleevffdvudeltdelueetlefghfeg geefvdelveevteenucffohhmrghinhepvgigrghmphhlvgdrsghuihhlugenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhho nhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Oct 2022 19:53:24 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: dev@dpdk.org, Anatoly Burakov , stable@dpdk.org Subject: Re: [PATCH v2] eal: fix data race in multi-process support Date: Mon, 10 Oct 2022 01:53:22 +0200 Message-ID: <1906914.fIoEIV5pvu@thomas> In-Reply-To: <20220906164522.91776-1-stephen@networkplumber.org> References: <20211217182922.159503-1-stephen@networkplumber.org> <20220906164522.91776-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 06/09/2022 18:45, Stephen Hemminger: > If DPDK is built with thread sanitizer it reports a race > in setting of multiprocess file descriptor. The fix is to > use atomic operations when updating mp_fd. > > Build: > $ meson -Db_sanitize=address build > $ ninja -C build > > Simple example: > $ .build/app/dpdk-testpmd -l 1-3 --no-huge > EAL: Detected CPU lcores: 16 > EAL: Detected NUMA nodes: 1 > EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem > EAL: Detected static linkage of DPDK > EAL: Multi-process socket /run/user/1000/dpdk/rte/mp_socket > EAL: Selected IOVA mode 'VA' > testpmd: No probed ethernet devices > testpmd: create a new mbuf pool : n=163456, size=2176, socket=0 > testpmd: preferred mempool ops selected: ring_mp_mc > EAL: Error - exiting with code: 1 > Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate memory > ================== > WARNING: ThreadSanitizer: data race (pid=87245) > Write of size 4 at 0x558e04d8ff70 by main thread: > #0 rte_mp_channel_cleanup (dpdk-testpmd+0x1e7d30c) > #1 rte_eal_cleanup (dpdk-testpmd+0x1e85929) > #2 rte_exit (dpdk-testpmd+0x1e5bc0a) > #3 mbuf_pool_create.cold (dpdk-testpmd+0x274011) > #4 main (dpdk-testpmd+0x5cc15d) > > Previous read of size 4 at 0x558e04d8ff70 by thread T2: > #0 mp_handle (dpdk-testpmd+0x1e7c439) > #1 ctrl_thread_init (dpdk-testpmd+0x1e6ee1e) > > As if synchronized via sleep: > #0 nanosleep ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:366 (libtsan.so.0+0x6075e) > #1 get_tsc_freq (dpdk-testpmd+0x1e92ff9) > #2 set_tsc_freq (dpdk-testpmd+0x1e6f2fc) > #3 rte_eal_timer_init (dpdk-testpmd+0x1e931a4) > #4 rte_eal_init.cold (dpdk-testpmd+0x29e578) > #5 main (dpdk-testpmd+0x5cbc45) > > Location is global 'mp_fd' of size 4 at 0x558e04d8ff70 (dpdk-testpmd+0x000003122f70) > > Thread T2 'rte_mp_handle' (tid=87248, running) created by main thread at: > #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x5ad75) > #1 rte_ctrl_thread_create (dpdk-testpmd+0x1e6efd0) > #2 rte_mp_channel_init.cold (dpdk-testpmd+0x29cb7c) > #3 rte_eal_init (dpdk-testpmd+0x1e8662e) > #4 main (dpdk-testpmd+0x5cbc45) > > SUMMARY: ThreadSanitizer: data race (/home/shemminger/DPDK/main/build/app/dpdk-testpmd+0x1e7d30c) in rte_mp_channel_cleanup > ================== > ThreadSanitizer: reported 1 warnings > > Fixes: bacaa2754017 ("eal: add channel for multi-process communication") > Signed-off-by: Stephen Hemminger > Acked-by: Anatoly Burakov Reviewed-by: Chengwen Feng +Cc: stable@dpdk.org Applied, thanks.