DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Artemy Kovalyov <artemyko@nvidia.com>, <dev@dpdk.org>
Cc: Thomas Monjalon <thomas@monjalon.net>, <stable@dpdk.org>
Subject: Re: [PATCH v2 5/5] eal: fix memzone fbarray cleanup
Date: Wed, 13 Mar 2024 17:17:04 +0100	[thread overview]
Message-ID: <2c593ca4-2e3c-4778-bc69-57e40af087d3@intel.com> (raw)
In-Reply-To: <20240307070113.29580-6-artemyko@nvidia.com>

On 3/7/2024 8:01 AM, Artemy Kovalyov wrote:
> The initialization of the Memzone file-backed array ensures its
> uniqueness by employing an exclusive lock. This is crucial because only
> one primary process can exist per specific shm_id, which is further
> protected by the exclusive EAL runtime configuration lock.
> 

I think you meant to say "prefix", not "shm_id".

> However, during the process closure, the exclusive lock on both the
> fbarray and the configuration is not explicitly released. The
> responsibility of releasing these locks is left to the generic quit
> procedure. This can lead to a potential race condition when the
> configuration is released before the fbarray.
> 
> To address this, we propose explicitly closing the memzone fbarray. This
> ensures proper order of operations during process closure and prevents
> any potential race conditions arising from the mismatched lock release
> timings.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Artemy Kovalyov <artemyko@nvidia.com>
> ---

I would suggest having a different Fixes: ID, because fbarrays were only 
added in 18.05 when we added dynamic memory support. I propose using 
this commit ID instead:

49df3db84883 ("memzone: replace memzone array with fbarray")

This is the first commit where memzones used fbarrays.

> +void
> +rte_eal_memzone_cleanup(void)
> +{
> +	struct rte_mem_config *mcfg;
> +
> +	mcfg = rte_eal_get_configuration()->mem_config;
> +
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> +		rte_fbarray_destroy(&mcfg->memzones);
> +	}

Nitpick: extraneous brackets, this is a one liner so they're not needed.

With changes above,

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
-- 
Thanks,
Anatoly


  reply	other threads:[~2024-03-13 16:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  4:25 [PATCH 0/5] addressing races in concurrent process startup Artemy Kovalyov
2023-12-12  4:25 ` [PATCH 1/5] app/test-pm: add multiprocess test Artemy Kovalyov
2023-12-12 17:09   ` Stephen Hemminger
2023-12-17  3:53   ` [PATCH v2 1/5] app/test-mp: " Artemy Kovalyov
2024-03-06 20:20     ` David Marchand
2024-03-07  6:59   ` [PATCH 0/5] addressing races in concurrent process startup Artemy Kovalyov
2024-03-07  7:01   ` Artemy Kovalyov
2024-03-07  7:01     ` [PATCH v2 1/5] app/test-mp: add multiprocess test Artemy Kovalyov
2024-03-13 16:05       ` Burakov, Anatoly
2024-03-07  7:01     ` [PATCH v2 2/5] eal: fix multiprocess hotplug race Artemy Kovalyov
2024-03-13 16:05       ` Burakov, Anatoly
2024-03-07  7:01     ` [PATCH v2 3/5] ipc: fix mp channel closure to prevent message loss Artemy Kovalyov
2024-03-13 16:06       ` Burakov, Anatoly
2024-03-07  7:01     ` [PATCH v2 4/5] eal: fix first time primary autodetect Artemy Kovalyov
2024-03-13 16:06       ` Burakov, Anatoly
2024-03-07  7:01     ` [PATCH v2 5/5] eal: fix memzone fbarray cleanup Artemy Kovalyov
2024-03-13 16:17       ` Burakov, Anatoly [this message]
2023-12-12  4:25 ` [PATCH 2/5] eal: fix multiprocess hotplug race Artemy Kovalyov
2023-12-12  4:25 ` [PATCH 3/5] ipc: fix mp channel closure to prevent message loss Artemy Kovalyov
2023-12-12  4:25 ` [PATCH 4/5] eal: fix first time primary autodetect Artemy Kovalyov
2023-12-12  4:25 ` [PATCH 5/5] eal: fix memzone fbarray cleanup 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=2c593ca4-2e3c-4778-bc69-57e40af087d3@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=artemyko@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.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).