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 1FF60A0543; Mon, 14 Nov 2022 21:44:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E26FD40DFD; Mon, 14 Nov 2022 21:44:06 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C042D40150 for ; Mon, 14 Nov 2022 21:44:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668458645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rtLjU8gr4e0JoVgBiQ210LjYWA9PLzBGejJVQ4fNxNE=; b=chpg6y1mTt6K/d2QMCR2Qk8DUrbeC56nycfnCo0BD/PAxQ56FhKE1dIa2mR2g5V7QXYAmy J0Ndy4xvb1l2KWeLK4vjdtcUDYUYK/2QWdrJSnCXaACya6AaLC5KwLPTMgJ4CO1YDEKyFN E6H5rYInOaJuu3hZWH5SsVMKvwZ+K3M= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-412-k0KjJ7OaPpWostK4-C6Vqg-1; Mon, 14 Nov 2022 15:44:03 -0500 X-MC-Unique: k0KjJ7OaPpWostK4-C6Vqg-1 Received: by mail-pj1-f70.google.com with SMTP id n9-20020a17090a2bc900b0021010dca313so5270110pje.7 for ; Mon, 14 Nov 2022 12:44:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=rtLjU8gr4e0JoVgBiQ210LjYWA9PLzBGejJVQ4fNxNE=; b=nKrUeGPJqOVfJvWQuT33w1Lo4B1hqunMgH4qZx9HtzVaomrpptkNVeTIiovqiy2v8H d/8JD01gw84NjDyUg/MHoi5IdQOdWG9OfGKlKxququqb5BZ79IWp++kBCX5beTnBh19M SbLsILQoh8bYrL9B0Pr2TF8nmnnpGs63pXhan+AvlLhYTjxQ5dS9jspAQxNUxso2pE+z Ab5ZGQWXfaFvKCuynxGoaJVcGwB/TCb3J0nllSXMbQ9erOOstXTSkLRwe3pb2rPmrGzy 6MkScPKIQGnenfztJdNtRl9r/k9InSqID/ZpAoUrsjXtzTnZQAkVvoFUOe5xVU0BCEGh Do3g== X-Gm-Message-State: ANoB5pngvy5YlXcZBcNZR0x8UMRaBRJmOoiGDlzn1fN4ohHF5zwKTEzL zmuF9thReKqhS5jVejke+42VCblBksLGCKBCVrowGg5Kk36U4H73kqo6colm4ywmonPptF0kaCs J93NWIpOVQISz1TSTXsQ= X-Received: by 2002:a17:902:6a8c:b0:188:6c5b:ffb0 with SMTP id n12-20020a1709026a8c00b001886c5bffb0mr840113plk.125.1668458642471; Mon, 14 Nov 2022 12:44:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf7LK16DZSnjtLDwSgU68Kyc2Fc32wlMWPIQiiHH4bP5ai+B2fgFPplGTSZ5lSFM5NuE4vpfP61U3o9WwZEVDMI= X-Received: by 2002:a17:902:6a8c:b0:188:6c5b:ffb0 with SMTP id n12-20020a1709026a8c00b001886c5bffb0mr840100plk.125.1668458642141; Mon, 14 Nov 2022 12:44:02 -0800 (PST) MIME-Version: 1.0 References: <20221114071439.38902-1-changfengnan@bytedance.com> In-Reply-To: <20221114071439.38902-1-changfengnan@bytedance.com> From: David Marchand Date: Mon, 14 Nov 2022 21:43:50 +0100 Message-ID: Subject: Re: [PATCH] mempool: fix rte_mempool_avail_count may segment fault when used in multiprocess To: changfengnan Cc: olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, =?UTF-8?Q?Morten_Br=C3=B8rup?= X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 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. > Fix this by put tailq entry into rte_mempool_tailq after populate. Moving tailq manipulation to rte_mempool_create only, is probably incorrect. 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. > > Signed-off-by: changfengnan Please use your real name. -- David Marchand