[PATCH v6] eal/linux: fix fbarray name collision in containers

David Marchand david.marchand at redhat.com
Mon Feb 16 18:22:48 CET 2026


On Fri, 13 Feb 2026 at 23:01, Stephen Hemminger
<stephen at networkplumber.org> wrote:
>
> From: Congjie Zhou <zcjie0802 at qq.com>
>
> When multiple secondary processes run in different containers that
> share the same hugetlbfs mount, the fbarray names can collide.
> This happens because containers use separate PID namespaces, so
> different processes in different containers can have the same PID.
>
> Fix by replacing the PID with a timestamp-based value. The TSC
> (timestamp counter) provides sufficient uniqueness since containers
> starting at the same CPU cycle is practically impossible - even 1ms
> of startup time difference means millions of cycles apart at GHz
> frequencies.
>
> Also, reduce the name buffer from PATH_MAX to RTE_FBARRAY_NAME_LEN
> since it is only used for the fbarray name.
>

Afaics, the filename generation comes from:
524e43c2ad9a ("mem: prepare memseg lists for multiprocess sync")

> Fixes: 046aa5c4477b ("mem: add memalloc init stage")

This change ^^ only moved the point in EAL init where the name was generated.


> Cc: stable at dpdk.org
>
> Signed-off-by: Congjie Zhou <zcjie0802 at qq.com>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>

Updated comment:
         * Base name: "memseg-1048576k-99-99" ~21 chars
         * Suffix "_<pid>_<16hex>" +24
-        * Total = 44 < RTE_FBARRAY_NAME_LEN 64
+        * Total = ~45 < RTE_FBARRAY_NAME_LEN 64

Applied, thanks.


-- 
David Marchand



More information about the stable mailing list