<div dir="ltr">Hi,<div>The issue is probably not with my code but with the compilation on DPDK,</div><div>because I got it to repeat on a separated program,</div><div>where I setup an EAL with the flags `-l 1 --no-pci`</div><div>(just rte_eal_init and rte_mempool_create)</div><div><br></div><div>this seems to be a memseg_list issue</div><div>When running the program above, and requesting large amounts of memory (200M elements of 8 bytes each)</div><div>I don't crash, but get `couldnt find suitable memseg_list` error</div><div>This also happens when trying to allocate from the main process</div><div><br></div><div>This error is probably related to these parameters from rte_config.h:<br><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container gmail-js-code-nav-container gmail-js-tagsearch-file" style="border-spacing:0px;border-collapse:collapse;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box"></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-LC30" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre"><span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">/*</span> EAL defines <span class="gmail-pl-c" style="box-sizing:border-box">*/</span></span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L31" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC31" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_HEAPS</span> <span class="gmail-pl-c1" style="box-sizing:border-box">32</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L32" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC32" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_MEMSEG_LISTS</span> <span class="gmail-pl-c1" style="box-sizing:border-box">128</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L33" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC33" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_MEMSEG_PER_LIST</span> <span class="gmail-pl-c1" style="box-sizing:border-box">8192</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L34" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC34" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_MEM_MB_PER_LIST</span> <span class="gmail-pl-c1" style="box-sizing:border-box">32768</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L35" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC35" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_MEMSEG_PER_TYPE</span> <span class="gmail-pl-c1" style="box-sizing:border-box">32768</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L36" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC36" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_MEM_MB_PER_TYPE</span> <span class="gmail-pl-c1" style="box-sizing:border-box">65536</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L37" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC37" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_MEMZONE</span> <span class="gmail-pl-c1" style="box-sizing:border-box">2560</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L38" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC38" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">#<span class="gmail-pl-k" style="box-sizing:border-box">define</span> <span class="gmail-pl-en" style="box-sizing:border-box">RTE_MAX_TAILQ</span> <span class="gmail-pl-c1" style="box-sizing:border-box">32</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L39" class="gmail-blob-num gmail-js-line-number gmail-js-code-nav-line-number gmail-js-blob-rnum" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td></tr></tbody></table><br class="gmail-Apple-interchange-newline"></div><div><br></div><div>I could not find a good documentation on how to calculate the proper values for these parameters</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 28, 2022 at 4:10 PM Dmitry Kozlyuk <<a href="mailto:dmitry.kozliuk@gmail.com">dmitry.kozliuk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2022-07-28 15:05 (UTC+0300), MOD:<br>
> Hi, Thanks for the response!<br>
> the DPDK version is 20.11.4<br>
> <br>
> the stack trace is:<br>
> malloc_elem_can_hold() // librte_eal.so.21<br>
> find_suitable_element() // librte_eal.so.21<br>
> malloc_heap_alloc() // librte_eal.so.21<br>
> rte_memzone_reserve_thread_safe() // librte_eal.so.21<br>
> rte_mempool_populate_default() // librte_mempool.so.21<br>
> rte_mempool_create() // librte_mempool.so.21<br>
<br>
Is this all the info---no arguments, no lines?<br>
You're using a debug build of DPDK, right?<br>
<br>
> RTE_MALLOC_DEBUG doesn't seem to change anything,<br>
> but I noticed that I have been wrong about the allocation succeeding<br>
> (not because of RTE_MALLOC_DEBUG)<br>
> <br>
> the error happens right on the first attempt.<br>
<br>
Did you try running with ASAN (meson -Db_sanitize=address)?<br>
<br>
Can you provide a short code to reproduce<br>
or does it happen only in a larger program?<br>
<br>
Please keep Cc: <a href="mailto:users@dpdk.org" target="_blank">users@dpdk.org</a> so that more people can join if they want.<br>
</blockquote></div>