On Wed, 20 May 2026 14:57:56 +0200
Michal Sieron <[email protected]> wrote:

> In rare cases, when a secondary process calls rte_eal_init() it can
> cause a data race during page prefaulting in alloc_seg().
> 
> An atomic compare-exchange in a loop should eliminate the data race.
> 
> Signed-off-by: Michal Sieron <[email protected]>
> ---

AI had good suggestion when reviewing this.
Your version is still racy (on the read side).

A simple non-racy, and no loop version would be:

        rte_atomic_fetch_or_explicit((int *)addr, 0, rte_memory_order_relaxed);

Reply via email to