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 AB61AA0547; Tue, 15 Nov 2022 12:33:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50F9640E03; Tue, 15 Nov 2022 12:33:19 +0100 (CET) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) by mails.dpdk.org (Postfix) with ESMTP id 9895B40150 for ; Tue, 15 Nov 2022 02:51:31 +0100 (CET) Received: by mail-yb1-f180.google.com with SMTP id k84so11427264ybk.3 for ; Mon, 14 Nov 2022 17:51:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9tHaKHmoIpBaYBDSRnNOVA17H8XErd113EQuiON483o=; b=MdzG0+TgLFJeOPe/OF4Pi1BP1VrBWYLGlM35TLhK3DfCOCUk87IoD4oR9n0Hb8yobT AUffpEnE8qTRxZDCqYdqNNFUWYHERLtk5sjN3OJS5veZnh3iBAT8caTP8FGD4SUPfRxs b4wH72OJeCNMoUUH6WD1gsecn6BAOO0mdG/rLKCBNegVod08pjn7ARIKxWRIRaTsG93h bRuQdO2mH7zMZ0a55yjkf6zs3HQAndVfB0SjaBEIUMSTyGj75dG4f2DvpOZcbmFNQ8Hu 7JrmfRQmZZjFTBzIA3VJf337wJibK243uT+jEDpfeBlMQjTrEGJEp9NUB7gOXupbbF+z f9Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9tHaKHmoIpBaYBDSRnNOVA17H8XErd113EQuiON483o=; b=tbniJ/LKrFc92tUV14RcMuv4V6/fpNvRwYRL2UPsTk9FQbFwaff31JGHGa1RPLCAwt AMfhtNByhzHPYxM++S6KMNo6PIG7f4cKMTSlC7fugQSUfb5nXj4oBnVCTCgERQw19hwT njT4eskjHeYixr1PznE24+J1a3Pmg3AeK6qygffWSFpH7XNsLLZ/wPjOb8g0jXrQLNOz Q95TPuMLmsHK8gtB65YPk+CJ0OEFxP6GuEzo23e06iu/4jAQ5sfkOq4N2gvnrMHmXaQ9 nAqu2MchClwta7kLuIGH/N1OpY74pqY71rOsAXSgf2C80bKyj9m8wxRMVpJ0pFHEX3Tc TWAQ== X-Gm-Message-State: ANoB5pkI+bLfkeRUMxGrB/FdeKENd06CXRaaTbI/k6fIP02uRawbEL28 MiaV5EDWJfID+A6NUPLbfp2bx/Qc4IAJjVeokMr+BQ== X-Google-Smtp-Source: AA0mqf7dixxiIRVW1BYXlVJuJG4WFvIE+emiaCmw6QjWtcjOTSE2z2ymT38+1fYmA45+H/uBHsJH3HOHh9V6R9FEiFc= X-Received: by 2002:a25:d451:0:b0:6ca:1f82:abbc with SMTP id m78-20020a25d451000000b006ca1f82abbcmr14410261ybf.429.1668477090796; Mon, 14 Nov 2022 17:51:30 -0800 (PST) MIME-Version: 1.0 References: <20221114071439.38902-1-changfengnan@bytedance.com> In-Reply-To: From: Fengnan Chang Date: Tue, 15 Nov 2022 09:51:19 +0800 Message-ID: Subject: Re: [External] Re: [PATCH] mempool: fix rte_mempool_avail_count may segment fault when used in multiprocess To: David Marchand Cc: olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, =?UTF-8?Q?Morten_Br=C3=B8rup?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 15 Nov 2022 12:33:18 +0100 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 David Marchand =E4=BA=8E2022=E5=B9=B411=E6=9C= =8815=E6=97=A5=E5=91=A8=E4=BA=8C 04:44=E5=86=99=E9=81=93=EF=BC=9A > > On Mon, Nov 14, 2022 at 9:13 AM changfengnan = wrote: > > > > rte_mempool_create put tailq entry into rte_mempool_tailq list before > > populate, and pool_data set when populate. So in multi process, if > > process A create mempool, and process B can get mempool through > > rte_mempool_lookup before pool_data set, if B call rte_mempool_lookup, > > it will cause segment fault. > > I fail to see how pool_data impacts rte_mempool_lookup. > Something is fishy about this commitlog. oh, it's my fault about this commit. correct: if B can get mempool through rte_mempool_lookup before pool_data set, and call rte_mempool_avail_count, it will cause segment fault. > > > > Fix this by put tailq entry into rte_mempool_tailq after populate. > > Moving tailq manipulation to rte_mempool_create only, is probably incorre= ct. > An application is allowed to call rte_mempool_create_empty() and > rte_mempool_populate(). > > I did not look in depth, but It is likely the reason why testpmd (as > run with devtools/test-null.sh) won't pass anymore. > The CI reported this issue in various envs. > > We can't take this patch. Yeah, this version makes CI fail. I didn't notice rte_mempool_create_empty will called directly before, maybe add a new flag bit to indicate when to put tailq entry into rte_mempool_tai= lq list is a better way. If no better idea, I'll send a new version. > > > > > > Signed-off-by: changfengnan > > Please use your real name. It's my real name. > > > -- > David Marchand >