From: Stephen Hemminger <stephen@networkplumber.org>
To: Michal Sieron <michal.sieron@nokia.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH] linux/mem: atomically prefault hugepages in alloc_seg
Date: Wed, 20 May 2026 10:07:38 -0700 [thread overview]
Message-ID: <20260520100738.7042b965@phoenix.local> (raw)
In-Reply-To: <20260520125756.530808-1-michal.sieron@nokia.com>
On Wed, 20 May 2026 14:57:56 +0200
Michal Sieron <michal.sieron@nokia.com> 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 <michal.sieron@nokia.com>
> ---
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);
next prev parent reply other threads:[~2026-05-20 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 12:57 [PATCH] linux/mem: atomically prefault hugepages in alloc_seg Michal Sieron
2026-05-20 14:57 ` Stephen Hemminger
2026-05-20 16:47 ` Stephen Hemminger
2026-05-20 17:07 ` Stephen Hemminger [this message]
2026-05-20 17:08 ` [PATCH] eal: fix data race in hugepage prefault Stephen Hemminger
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=20260520100738.7042b965@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=michal.sieron@nokia.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
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