patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Joyce Kong <joyce.kong@arm.com>
Cc: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	Olivier Matz <olivier.matz@6wind.com>,
	 Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"Wang, Yipeng1" <yipeng1.wang@intel.com>,
	 "Gobriel, Sameh" <sameh.gobriel@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	 Vladimir Medvedkin <vladimir.medvedkin@intel.com>,
	 "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	 Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,
	 "Ruifeng Wang (Arm Technology China)" <ruifeng.wang@arm.com>,
	dev <dev@dpdk.org>, nd <nd@arm.com>,
	 dpdk stable <stable@dpdk.org>, Aaron Conole <aconole@redhat.com>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] test/func_reentrancy: free memzones after creating test case
Date: Tue, 17 Aug 2021 10:17:17 +0200	[thread overview]
Message-ID: <CAJFAV8xUYgJ_BFEJ0yM6yjKW4k++qQHsv_8zdiTmkP7c0f91fA@mail.gmail.com> (raw)
In-Reply-To: <20210731120336.30886-1-joyce.kong@arm.com>

On Sat, Jul 31, 2021 at 2:04 PM Joyce Kong <joyce.kong@arm.com> 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 <joyce.kong@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Feifei Wang <feifei.wang2@arm.com>

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


  reply	other threads:[~2021-08-17  8:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  7:33 [dpdk-stable] [PATCH v1] " Joyce Kong
2021-07-30 11:27 ` Olivier Matz
2021-07-31  8:42   ` Joyce Kong
2021-07-31 12:03 ` [dpdk-stable] [PATCH v2] " Joyce Kong
2021-08-17  8:17   ` David Marchand [this message]
2021-08-20  7:57     ` [dpdk-stable] [dpdk-dev] " Joyce Kong
2021-08-20  8:52       ` David Marchand
2021-08-23  2:25         ` Joyce Kong
2021-08-20  8:12 ` [dpdk-stable] [PATCH v3] test/func_reentrancy: free memzones after creating test Joyce Kong
2021-08-23  2:57 ` [dpdk-stable] [PATCH v4] " Joyce Kong
2021-09-16 15:04   ` Olivier Matz
2021-09-16 15:09     ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJFAV8xUYgJ_BFEJ0yM6yjKW4k++qQHsv_8zdiTmkP7c0f91fA@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=aconole@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=joyce.kong@arm.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=nd@arm.com \
    --cc=olivier.matz@6wind.com \
    --cc=ruifeng.wang@arm.com \
    --cc=sameh.gobriel@intel.com \
    --cc=stable@dpdk.org \
    --cc=vladimir.medvedkin@intel.com \
    --cc=yipeng1.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).