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 DB57EA0C43 for ; Tue, 17 Aug 2021 10:17:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC9B841189; Tue, 17 Aug 2021 10:17:34 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id F03D240DF5 for ; Tue, 17 Aug 2021 10:17:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629188251; 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=StD/nzuSccjviRo0km4MAClxjY2dvsrL4/C5dzGBzyI=; b=F5GFBBiFpIiqRO+rDvzBQ5EnYCmG7D0Gsyu0wR++8SykOJjKks28ZTX79tukkSfxG6+W/D ZR7KD1zVQ9ssXyTttD0twngGkhtfjN5lTMsWmU5x9YMVZcW8mPg85pq5dFo/DLOFFFp4gP aJ31tgLoVJ8HSh93ob4b/UXOnHBTYCo= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-kHJS9Q7KPxqJ8J43jpMFoQ-1; Tue, 17 Aug 2021 04:17:29 -0400 X-MC-Unique: kHJS9Q7KPxqJ8J43jpMFoQ-1 Received: by mail-vk1-f198.google.com with SMTP id v4-20020a056122120400b00287008c5102so285034vkc.6 for ; Tue, 17 Aug 2021 01:17:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=StD/nzuSccjviRo0km4MAClxjY2dvsrL4/C5dzGBzyI=; b=rpTbQs0bp2Iigfi6v4Vgkq1a2SF7HD/F2F3v0eDRbkI1CnMvohqVP5rDUxcfoMNj9d WLhmfbtefDtsvH37PBuANLZm451ayicvj/uLT7EintdvJFDxaIvGaFz8LZtxnJfA9UeL u3BhL+o8MGZSja75+GVvK2ZKRHWr/pEcrpF16kJBl1qKxLByouQcTbV5c2Yw0jZmb698 MtngnjK85ZhBCDHoW46iuMskK6OJqYiqKQ0RviUona+7cp8jBpCZ0Sp8okuIzkqobwbY qz4DU8hMa4OBrq07vUGVrKsT9ca8ZW7sUAI92T1CWJkRZpbF9wgyTzhU6lfpkLENzCy5 Cd3A== X-Gm-Message-State: AOAM5330v+30aI1FkSibiZ+LTnoJsIS8ZkeRN1F9BKbhxn7z3MiVdspM lfFR7b5OU3mSo4tQ+8TZCNDBDvEG78mL14jd3EYmaVsMf9GXIS4DsLjNsLoEQ9nnbtjWRa5oRTD CKrDgzqEXpnwWuHyCYponTgo= X-Received: by 2002:a05:6102:2004:: with SMTP id p4mr1631472vsr.5.1629188249328; Tue, 17 Aug 2021 01:17:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUprAvlwkXqG4CiB58xuSB/uPUujMzU/owKIxpe0WpPU0C0NQ9ARTKNp1dbbWli9t/0QD+H1HBFHyLQX0EdLs= X-Received: by 2002:a05:6102:2004:: with SMTP id p4mr1631455vsr.5.1629188248931; Tue, 17 Aug 2021 01:17:28 -0700 (PDT) MIME-Version: 1.0 References: <20210728073322.27011-1-joyce.kong@arm.com> <20210731120336.30886-1-joyce.kong@arm.com> In-Reply-To: <20210731120336.30886-1-joyce.kong@arm.com> From: David Marchand Date: Tue, 17 Aug 2021 10:17:17 +0200 Message-ID: To: Joyce Kong Cc: "Burakov, Anatoly" , Olivier Matz , Andrew Rybchenko , "Wang, Yipeng1" , "Gobriel, Sameh" , Bruce Richardson , Vladimir Medvedkin , "Ananyev, Konstantin" , Honnappa Nagarahalli , "Ruifeng Wang (Arm Technology China)" , dev , nd , dpdk stable , Aaron Conole Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] test/func_reentrancy: free memzones after creating test case 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 Sender: "stable" On Sat, Jul 31, 2021 at 2:04 PM Joyce Kong wrote: > > Function reentrancy test limits maximum number of iterations > simultaneously, however it doesn't free the 'fr_test_once' > memzones after the fact, so introduce freeing 'fr_test_once' > in ring/mempool/hash/fbk/lpm_clean. > > Meanwhile, add the missing free for test case on main thread. > > Fixes: 104a92bd026f ("app: add reentrancy tests") > Fixes: 995eec619024 ("test: clean up memory for function reentrancy test") > Cc: stable@dpdk.org > > Signed-off-by: Joyce Kong > Reviewed-by: Ruifeng Wang > Reviewed-by: Feifei Wang This patch actually breaks the test (we are lucky, the failure happens often ;)). 28/94 DPDK:fast-tests / func_reentrancy_autotest FAIL 0.22s (exit status 255 or signal 127 SIGinvalid) --- command --- 16:13:45 DPDK_TEST='func_reentrancy_autotest' /home-local/jenkins-local/jenkins-agent/workspace/Generic-Unit-Test-DPDK/dpdk/build/app/test/dpdk-test -l 0-15 --file-prefix=func_reentrancy_autotest --- stdout --- RTE>>func_reentrancy_autotest Func-ReEnt CASE 0: eal init once PASS ring create/lookup: common object allocated 2 times (should be 1) Func-ReEnt CASE 1: ring create/lookup FAIL Test Failed RTE>> --- stderr --- I guess, this is what happens: main lcore worker lcore 1 ... worker lcore X enters ring_create_lookup() enters ring_create_lookup() rte_eal_wait_lcore(worker lcore 1); leaves ring_create_lookup() ring_clean(worker lcore 1); leaves ring_create_lookup() There is no synchronisation point for the main lcore to know the worker lcores are finished invoking the func callback. With this patch, the "common" object is freed by the main lcore *potentially* before some workers start trying to create it. And we end up with multiple workers successfully creating this object, hence the obj_count being incremented. -- David Marchand