Hi Lewis,

2024-05-27 19:34 (UTC-0500), Lewis Donzis:
> I've been wondering why we exclude memory allocated by eal_get_virtual_area() 
> from core dumps? (More specifically, it calls eal_mem_set_dump() to call 
> madvise() to disable core dumps from the allocated region.) 
> 
> On many occasions, when debugging after a crash, it would have been very 
> convenient to be able to see the contents of an mbuf or other object 
> allocated in contigmem space. And we often avoid using the rte memory 
> allocator just because of this. 
> 
> Is there any reason for this, or could it perhaps be a compile-time 
> configuration option not to call madvise()? 

Memory reserved by eal_get_virtual_area() is not yet useful,
but it is very large, so by excluding it from dumps,
DPDK prevents dumps from including large zero-filled parts.

It also makes sense to call eal_mem_set_dump(..., false)
from eal_memalloc.c:free_seg(), because of --huge-unlink=never:
in this mode (Linux-only), freed segments are not cleared,
so if they were included into dump, it would be a lot of garbage data.

Newly allocated hugepages are not included into dumps
because this would make dumps very large by default.
However, this could be an opt-in as a runtime option if need be.

Reply via email to