Mempool bigger than 1 page causes segmentation fault

MOD sdk.register at gmail.com
Sun Jul 31 13:32:47 CEST 2022


Hi,
The issue is probably not with my code but with the compilation on DPDK,
because I got it to repeat on a separated program,
where I setup an EAL with the flags `-l 1 --no-pci`
(just rte_eal_init and rte_mempool_create)

this seems to be a memseg_list issue
When running the program  above, and requesting large amounts of memory
(200M elements of 8 bytes each)
I don't crash, but get `couldnt find suitable memseg_list` error
This also happens when trying to allocate from  the main process

This error is probably related to these parameters from rte_config.h:
/* EAL defines */
#define RTE_MAX_HEAPS 32
#define RTE_MAX_MEMSEG_LISTS 128
#define RTE_MAX_MEMSEG_PER_LIST 8192
#define RTE_MAX_MEM_MB_PER_LIST 32768
#define RTE_MAX_MEMSEG_PER_TYPE 32768
#define RTE_MAX_MEM_MB_PER_TYPE 65536
#define RTE_MAX_MEMZONE 2560
#define RTE_MAX_TAILQ 32


I could not find a good documentation on how to calculate the proper values
for these parameters


On Thu, Jul 28, 2022 at 4:10 PM Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
wrote:

> 2022-07-28 15:05 (UTC+0300), MOD:
> > Hi, Thanks for the response!
> > the DPDK version is 20.11.4
> >
> > the stack trace is:
> > malloc_elem_can_hold() // librte_eal.so.21
> > find_suitable_element() // librte_eal.so.21
> > malloc_heap_alloc()  // librte_eal.so.21
> > rte_memzone_reserve_thread_safe()  // librte_eal.so.21
> > rte_mempool_populate_default()  // librte_mempool.so.21
> > rte_mempool_create() // librte_mempool.so.21
>
> Is this all the info---no arguments, no lines?
> You're using a debug build of DPDK, right?
>
> > RTE_MALLOC_DEBUG doesn't seem to change anything,
> > but I noticed that I have been wrong about the allocation succeeding
> > (not because of RTE_MALLOC_DEBUG)
> >
> > the error happens right on the first attempt.
>
> Did you try running with ASAN (meson -Db_sanitize=address)?
>
> Can you provide a short code to reproduce
> or does it happen only in a larger program?
>
> Please keep Cc: users at dpdk.org so that more people can join if they want.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/users/attachments/20220731/445b2872/attachment.htm>


More information about the users mailing list