[PATCH v2] eal: fix data race in hugepage prefault
Thomas Monjalon
thomas at monjalon.net
Wed Jun 3 17:57:39 CEST 2026
01/06/2026 18:00, Stephen Hemminger:
> The prefault step in alloc_seg() reads a value from the hugepage and
> writes it back unchanged to force the kernel to commit the backing
> page. The read and write were not atomic, which races with concurrent
> access to the same physical page from a secondary process attaching
> to the hugetlbfs-backed mapping during rte_eal_init().
>
> Replace the non-atomic load+store with a single atomic fetch-or of
> zero. This touches the page with an atomic read-modify-write without
> changing its contents, eliminating the race while preserving the
> original intent of forcing a write fault.
>
> Fixes: 0f1631be24bd ("mem: fix page fault trigger")
> Cc: stable at dpdk.org
>
> Reported-by: Michal Sieron <michal.sieron at nokia.com>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Applied, thanks.
More information about the dev
mailing list