From: David Marchand <david.marchand@redhat.com>
To: Artemy Kovalyov <artemyko@nvidia.com>
Cc: "Dmitry Kozlyuk" <dmitry.kozliuk@gmail.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
"Ophir Munk" <ophirmu@nvidia.com>,
"stable@dpdk.org" <stable@dpdk.org>,
"Anatoly Burakov" <anatoly.burakov@intel.com>,
"Morten Brørup" <mb@smartsharesystems.com>,
"Stephen Hemminger" <stephen@networkplumber.org>
Subject: Re: [PATCH v2] eal: fix memory initialization deadlock
Date: Tue, 5 Sep 2023 12:15:02 +0200 [thread overview]
Message-ID: <CAJFAV8y=ERY-igb4Abch6R2DiOW4K6rCxgH3Oa=Z3ZTjwYCR+g@mail.gmail.com> (raw)
In-Reply-To: <DM8PR12MB541667793E7E6AD0499BF89EBAE8A@DM8PR12MB5416.namprd12.prod.outlook.com>
On Tue, Sep 5, 2023 at 11:05 AM Artemy Kovalyov <artemyko@nvidia.com> wrote:
>
> > > + /* memory_hotplug_lock is taken in rte_eal_init(), so it's
> > > + * safe to call thread-unsafe version.
> > > + */
> >
> > Nit: the lock is really taken in rte_eal_memory_init().
> > Probably "The lock is held during initialization, so..."
> > would more robust against code changes and differences between platforms.
>
> It was previously located differently, but in the current version, it has been shifted to rte_eal_init(). It might be worth noting this to ensure that if there are further code changes in the future, the locking problem becomes more apparent. We had discussed this in the bug report.
One option to explore is lock annotations.
One note thought: those annotations do not get inherited in called code.
So some special care is needed to maintain/annotate all code leading
to the locations where the locks do matter.
Quick example with rte_memseg_list_walk:
https://github.com/david-marchand/dpdk/commit/mem_annotations
And clang catches a deadlock:
https://github.com/david-marchand/dpdk/actions/runs/6082842080/job/16501450978#step:19:816
--
David Marchand
next prev parent reply other threads:[~2023-09-05 10:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 10:33 [PATCH] " Artemy Kovalyov
2023-08-30 19:13 ` Dmitry Kozlyuk
2023-09-04 8:24 ` [PATCH v2] " Artemy Kovalyov
2023-09-05 7:05 ` Dmitry Kozlyuk
2023-09-05 9:05 ` Artemy Kovalyov
2023-09-05 10:15 ` David Marchand [this message]
2023-09-06 9:52 ` [PATCH v3] " Artemy Kovalyov
2023-09-06 12:52 ` David Marchand
[not found] ` <20230908131737.1714750-1-artemyko@nvidia.com>
2023-09-08 13:17 ` [PATCH v4 1/2] " Artemy Kovalyov
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='CAJFAV8y=ERY-igb4Abch6R2DiOW4K6rCxgH3Oa=Z3ZTjwYCR+g@mail.gmail.com' \
--to=david.marchand@redhat.com \
--cc=anatoly.burakov@intel.com \
--cc=artemyko@nvidia.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=mb@smartsharesystems.com \
--cc=ophirmu@nvidia.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/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).