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 59AB4A0548; 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 CDCA740DF5; Tue, 17 Aug 2021 10:17:33 +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 EBD404014E 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-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-187-5CKOZI7mOrmyfGI-BDdXvQ-1; Tue, 17 Aug 2021 04:17:29 -0400 X-MC-Unique: 5CKOZI7mOrmyfGI-BDdXvQ-1 Received: by mail-vs1-f69.google.com with SMTP id f26-20020a67d89a000000b002c3277c14a9so1268048vsj.2 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=KNk6RxjFSr8S1YL8n6bY+QRzeyohMtC0mRXDpo9eh02jnYwYIned/1mI1klYYUZdn3 7A7GZRp1YAKYDiVhfPnDMScQqiogSAgws7dRRcaJOM9oNC8Ne9+/lqMY0nKKYdbcSULu +WE8l1h9RIS9CLpXXxAj3Zk2OiWllO99mDhjJKobkUQBOWdf72SXCTG6JYvzlCFcsDY0 xVi0O/0b1ky8i2UJf90qx2tY0XX3ELzwmmFrFGfUKokGEQHo/JoG3UB4Kitrax7fsPyG 0rxYUW1seAmQDpvWBihq1646I3fr6nVd87HGAI+nm8S52ph4ltsx0xBfGQgTfCoIHvIE DHCA== X-Gm-Message-State: AOAM531L0yCRa8USXvrShqeQxVisMv8151bfmvQGjJi8WFh7vf367O7i awwwNMRGoNuImBkkprb5LA6pMWkppIjbOukih1c4AgVyDWJEVbqeFIx2MAbw89/xF3RQ3ZZN/yA umB9S5MuNBhOfalEjJDs= X-Received: by 2002:a05:6102:2004:: with SMTP id p4mr1631483vsr.5.1629188249329; 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-dev] [PATCH v2] test/func_reentrancy: free memzones after creating test case 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 Sender: "dev" 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