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

Burakov, Anatoly anatoly.burakov at intel.com
Mon May 22 14:43:37 CEST 2023


On 5/22/2023 1:09 PM, Fengnan Chang wrote:
> Burakov, Anatoly <anatoly.burakov at intel.com> 于2023年5月20日周六 23:03写道:
>>
>> Hi,
>>
>> On 5/16/2023 1:21 PM, Fengnan Chang 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.
>>>
>>> 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.
>>
>> Unrelated, but this is probably a wrong message, this should've called
>> out the config options to change, not their values. Sounds like a log
>> message needs fixing somewhere...
> 
> In the older version, the log is:
> EAL: Could not find space for memseg. Please increase
> CONFIG_RTE_MAX_MEMSEG_PER_TYPE and/or CONFIG_RTE_MAX_MEM_PER_TYPE in
> configuration.
> Maybe it's better ?
> 

It was better indeed, but this seems to have to do with the fact that 
RTE_STR doesn't treat valid macros like a string, it expands them.

So, e.g. `RTE_STR(INVALID_MACRO)` gets translated to `INVALID_MACRO` 
string, while `RTE_STR(RTE_MAX_LCORE)` gets translated to whatever 
actual value `RTE_MAX_LCORE` has (128 in my case).

Using `_RTE_STR` in place of `RTE_STR` fixes the issue, but i'm not sure 
if it's the right solution, as `_RTE_STR` is prefixed with an 
underscore, which implies it's not to be used directly.

+Thomas thoughts?
-- 
Thanks,
Anatoly



More information about the dev mailing list