<div id="editor_version_1.20.3_mCzEYXPI" style="word-break:break-word"><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">When doing </span><span style="font-size:14px">test</span><span style="font-size:14px"> in </span><span style="font-size:14px">spdk</span><span style="font-size:14px">, we found a problem: when we try </span><span style="font-size:14px">alloc</span><span style="font-size:14px"> 2048 </span><span style="font-size:14px">hugepages</span><span style="font-size:14px"> for </span><span style="font-size:14px">dpdk</span><span style="font-size:14px">, sometimes memory </span><span style="font-size:14px">init would be fail</span><span style="font-size:14px">. </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">This is some useful log:</span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Detected memory type: socket_id:0 hugepage_sz:2097152 </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Detected memory type: socket_id:1 hugepage_sz:2097152 </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Creating 4 segment lists: n_segs:8192 socket_id:0 hugepage_sz:2097152 </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">... </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Trying to obtain current memory policy. </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Requesting 11264 pages of size 2MB from socket 0 </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Requesting 9216 pages of size 2MB from socket 1 </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Attempting to map 22528M on socket 0 </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Could not find space for memseg. Please increase 32768 and/or 65536 in configuration. </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: Couldn't remap </span><span style="font-size:14px">hugepage</span><span style="font-size:14px"> files into memseg lists </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">EAL: FATAL: Cannot init memory </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><br></div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">And the </span><span style="font-size:14px">hugepages</span><span style="font-size:14px"> mapping in node:</span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">cat /sys/devices/system/node/node*/hugepages/hugepages-2048kB/nr_hugepages </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">11264 </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">9216
</span></div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">This is some config about memseg:
</span></div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px">#define RTE_MAX_MEMSEG_LISTS 128
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px">#define RTE_MAX_MEMSEG_PER_LIST 8192
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px">#define RTE_MAX_MEM_MB_PER_LIST 32768
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px">#define RTE_MAX_MEMSEG_PER_TYPE 32768
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px">#define RTE_MAX_MEM_MB_PER_TYPE 65536<span style="font-size:14px">
</span></div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><br></div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><span style="font-size:14px">We found if the number of continuous hugepgaes larger than RTE_MAX_MEMSEG_PER_LIST, remap_segment would fail, even though we have other memseg lists can use. As the log showed, we have 4 memseg lists, each can hold 8192 segment, but if we have 11264 continuous hugepgaes, remap_segment can not find a single memseg list to hold those hugepgaes. So my question is why remap_segment have to map a chunk of continuous hugepgaes to a single memseg list ? Can we split it to two memseg lists? We had tried to do like this, it seems ok for our environment. Is there any potential risk ? </span>
</div></div><div style="margin-top:4px;margin-bottom:4px;line-height:1.6"><div style="font-size:14px"><br></div></div></div>