DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: oulijun <oulijun@huawei.com>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v4 2/5] examples/multi_process: cleanup bus objects while terminating app
Date: Thu, 4 Feb 2021 13:53:26 +0100
Message-ID: <CAJFAV8xtc88ycbN40YGNi1YMiLYf8XGbX0ff1Gi7aM6Mb75teQ@mail.gmail.com> (raw)
In-Reply-To: <0c5203ec-2497-0be0-925a-834aa95fcc5a@huawei.com>

On Mon, Jan 25, 2021 at 12:07 PM oulijun <oulijun@huawei.com> wrote:
> >> +static void
> >> +signal_handler(int signal)
> >> +{
> >> +       if (signal == SIGINT)
> >> +               rte_eal_cleanup();
> >> +       exit(0);
> >> +}
> >
> > Calling rte_eal_cleanup from a signal handler is a bad idea.
> > In most cases, you are racing with other threads still using DPDK resources.
> > https://git.dpdk.org/dpdk/commit?id=2c434431f4
> > https://git.dpdk.org/dpdk/commit?id=613ce6691c
> >
> > This might not be a problem in this multi_process example, but let's
> > keep a consistent way across all examples.
> > Thanks.
> Hi,
>    I want to know why you don't think he's a problem. recently, we use
> the patch
> https://patchwork.dpdk.org/patch/86988/
> startup with multiprocess. Use the tester to send traffic and kill the
> slave process repeatedly.
> The coredump exception occurs. According to my analysis, the cause is
> that resources are not released after the slave process is killed.
>

Not sure I get your question and I don't see the relation with the
testpmd patch.
I did not say we must not release resources.

Just to rephrase my previous mail:

Generally speaking, calling rte_eal_cleanup() from a signal handler is
wrong since it creates races with other threads.
I recommend putting in place a synchronisation mechanism so that all
worker threads break out of their processing loop and the main thread
synchronizes/joins with them before calling rte_eal_cleanup() in its
exit path.

Now, for this patch, in
examples/multi_process/client_server_mp/mp_client/client.c, this
secondary process code seems to only have one thread (but I might be
wrong).
If this is true, then no race in theory => my comment "This might not
be a problem in this multi_process example".


-- 
David Marchand


  reply	other threads:[~2021-02-04 12:53 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24  8:24 [dpdk-dev] [PATCH v2 1/3] eal: add API for bus close rohit.raj
2020-08-24  8:24 ` [dpdk-dev] [PATCH v2 2/3] examples/multi_process: cleanup bus objects while terminating app rohit.raj
2020-09-08  5:32   ` Hemant Agrawal
2020-08-24  8:24 ` [dpdk-dev] [PATCH v2 3/3] bus/fslmc: support bus close API rohit.raj
2020-08-24 15:14 ` [dpdk-dev] [PATCH v2 1/3] eal: add API for bus close Stephen Hemminger
2020-08-26  5:52 ` [dpdk-dev] [PATCH v3 " rohit.raj
2020-08-26  5:52   ` [dpdk-dev] [PATCH v3 2/3] examples/multi_process: cleanup bus objects while terminating app rohit.raj
2020-09-08  5:32     ` Hemant Agrawal
2020-08-26  5:52   ` [dpdk-dev] [PATCH v3 3/3] bus/fslmc: support bus close API rohit.raj
2020-09-08  5:35     ` Hemant Agrawal (OSS)
2020-09-17 15:35     ` Kinsella, Ray
2020-09-08  4:46   ` [dpdk-dev] [PATCH v3 1/3] eal: add API for bus close Hemant Agrawal
2020-09-23 23:54     ` Thomas Monjalon
2020-09-17 15:34   ` Kinsella, Ray
2020-09-24 11:39   ` Ferruh Yigit
2020-09-29  4:33   ` Sachin Saxena (OSS)
2020-09-30 11:50   ` Ferruh Yigit
2020-10-08 16:24     ` Ferruh Yigit
2020-10-09  4:53       ` [dpdk-dev] [EXT] " Rohit Raj
2020-10-18  9:25         ` David Marchand
2020-10-08 15:30   ` [dpdk-dev] [PATCH v4 1/5] " rohit.raj
2020-10-08 15:30     ` [dpdk-dev] [PATCH v4 2/5] examples/multi_process: cleanup bus objects while terminating app rohit.raj
2020-10-18  9:25       ` David Marchand
2021-01-25 11:07         ` oulijun
2021-02-04 12:53           ` David Marchand [this message]
2020-10-08 15:30     ` [dpdk-dev] [PATCH v4 3/5] bus/fslmc: support bus close API rohit.raj
2020-10-08 15:30     ` [dpdk-dev] [PATCH v4 4/5] eal/freebsd: added support for rte_bus_close API rohit.raj
2020-10-08 15:30     ` [dpdk-dev] [PATCH v4 5/5] eal/windows: " rohit.raj
2020-10-11  8:06       ` Tal Shnaiderman
2020-10-27  5:55       ` Narcisa Ana Maria Vasile
2020-10-18  9:21     ` [dpdk-dev] [PATCH v4 1/5] eal: add API for bus close 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=CAJFAV8xtc88ycbN40YGNi1YMiLYf8XGbX0ff1Gi7aM6Mb75teQ@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=oulijun@huawei.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git