DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal: fix eal init may failed when too much continuous memsegs under legacy mode
@ 2023-05-16 12:21 Fengnan Chang
  2023-05-20 15:03 ` Burakov, Anatoly
  0 siblings, 1 reply; 4+ messages in thread
From: Fengnan Chang @ 2023-05-16 12:21 UTC (permalink / raw)
  To: anatoly.burakov, dev; +Cc: Fengnan Chang, Lin Li

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.

For example:
hugepage configure:
20480
13370
7110

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

Signed-off-by: Fengnan Chang <changfengnan@bytedance.com>
Signed-off-by: Lin Li <lilintjpu@bytedance.com>
---
 lib/eal/linux/eal_memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c
index 60fc8cc6ca..36b9e78f5f 100644
--- a/lib/eal/linux/eal_memory.c
+++ b/lib/eal/linux/eal_memory.c
@@ -1001,6 +1001,8 @@ remap_needed_hugepages(struct hugepage_file *hugepages, int n_pages)
 		if (cur->size == 0)
 			break;
 
+		if (cur_page - seg_start_page >= RTE_MAX_MEMSEG_PER_LIST)
+			new_memseg = 1;
 		if (cur_page == 0)
 			new_memseg = 1;
 		else if (cur->socket_id != prev->socket_id)
-- 
2.37.1 (Apple Git-137.1)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-22 12:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16 12:21 [PATCH] eal: fix eal init may failed when too much continuous memsegs under legacy mode Fengnan Chang
2023-05-20 15:03 ` Burakov, Anatoly
2023-05-22 12:09   ` [External] " Fengnan Chang
2023-05-22 12:43     ` Burakov, Anatoly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).