[PATCH v2] eal: fix memory initialization deadlock
David Marchand
david.marchand at redhat.com
Tue Sep 5 12:15:02 CEST 2023
On Tue, Sep 5, 2023 at 11:05 AM Artemy Kovalyov <artemyko at 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
More information about the dev
mailing list