Hello David, > I have some trouble figuring the need for the list of files. > Why not use a global knob --mem-clear-on-alloc for this behavior change?
Moving memset() doesn't speed anything up, it's a forced step for the reasons below. Currently, memory is cleared by the kernel when a page is mapped during an allocation. This cannot be turned off in stock kernels. The issue is that initial allocations are longer by the time needed to clear the pages, which is >90%. For the memory intended for DMA this time is just wasted. If allocations are large, application startup and restart take long. The only way to get hugepages mapped without the kernel clearing them is to map existing files in hugetlbfs. However, rte_zmalloc() needs to return clean memory, that's why we move memset() there. Memory intended for DMA is just never cleared this way. But memory freed and allocated again will be cleared again, unfortunately.