[PATCH v4] eal: fix eal init may failed when too much continuous memsegs under legacy mode

David Marchand david.marchand at redhat.com
Wed Jun 7 22:32:40 CEST 2023


On Mon, May 29, 2023 at 1:23 PM Fengnan Chang
<changfengnan at bytedance.com> wrote:
>
> Under legacy mode, if the number of continuous memsegs greater
> than RTE_MAX_MEMSEG_PER_LIST, eal init will failed even though
> another memseg list is empty, because only one memseg list used
> to check in remap_needed_hugepages.
> Fix this by make remap_segment return how many segments mapped,
> remap_segment try to map most contiguous segments it can, if
> exceed it's capbility, remap_needed_hugepages will continue to
> map other left pages.
>
> For example:
> hugepage configure:
> cat /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages
> 10241
> 10239
>
> startup log:
> EAL: Detected memory type: socket_id:0 hugepage_sz:2097152
> EAL: Detected memory type: socket_id:1 hugepage_sz:2097152
> EAL: Creating 4 segment lists: n_segs:8192 socket_id:0 hugepage_sz:2097152
> EAL: Creating 4 segment lists: n_segs:8192 socket_id:1 hugepage_sz:2097152
> EAL: Requesting 13370 pages of size 2MB from socket 0
> EAL: Requesting 7110 pages of size 2MB from socket 1
> EAL: Attempting to map 14220M on socket 1
> EAL: Allocated 14220M on socket 1
> EAL: Attempting to map 26740M on socket 0
> EAL: Could not find space for memseg. Please increase 32768 and/or 65536 in
> configuration.
> EAL: Couldn't remap hugepage files into memseg lists
> EAL: FATAL: Cannot init memory
> EAL: Cannot init memory

We are missing a Fixes: tag and this is backport material, right?


>
> Signed-off-by: Fengnan Chang <changfengnan at bytedance.com>
> Signed-off-by: Lin Li <lilintjpu at bytedance.com>

Can I update Lin Li existing entry in .mailmap? Or is this a different person?


> Signed-off-by: Burakov Anatoly <anatoly.burakov at intel.com>
Anatoly Burakov*

> Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>

Strange to have both SoB and Review tag from Anatoly.


> ---
>  lib/eal/linux/eal_memory.c | 51 +++++++++++++++++++++++++++-----------

Is this issue affecting only Linux?



-- 
David Marchand



More information about the dev mailing list