[PATCH] eal/linux: fix dirty flag for reused hugepages in legacy mem
David Marchand
david.marchand at redhat.com
Tue Nov 10 18:39:47 CET 2026
On Thu, 5 Nov 2026 at 08:17, Maayan Kashani <mkashani at nvidia.com> wrote:
>
> With --huge-unlink=never the hugepage files are kept and mapped again
> on the next run. The kernel only zeroes a hugepage the first time it is
> mapped from a given file, so these pages still hold the previous run's
> content.
>
> The dynamic memory path records this by setting RTE_MEMSEG_FLAG_DIRTY
> in alloc_seg(). The legacy path in remap_segment() never sets ms->flags,
> so rte_zmalloc_socket() skips the memset and returns stale data.
>
> With --legacy-mem --huge-unlink=never, a second process gets non-zeroed
> memory from rte_zmalloc(). mlx5 with sys_mem_en disabled allocates its
> internal structures through rte_zmalloc_socket() and then reads stale
> pointers from them, which crashes in mlx5_ipool_malloc_cache() during
> probe:
>
> SEGV on unknown address 0x000000000308
> #0 _mlx5_ipool_malloc_cache drivers/net/mlx5/mlx5_utils.c:550
> ...
> #16 mlx5_alloc_shared_dr drivers/net/mlx5/linux/mlx5_os.c:628
>
> Set RTE_MEMSEG_FLAG_DIRTY on segments remapped in legacy mode whenever
> existing hugepage files are reused, matching the dynamic path. Why a
> reused page is dirty is documented on unlink_existing.
>
> Fixes: 32b4771cd8ef ("eal/linux: allow hugepage file reuse")
> Cc: stable at dpdk.org
>
> Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
Applied, thanks.
--
David Marchand
More information about the dev
mailing list