[PATCH] eal: speed up dpdk init time

Stephen Hemminger stephen at networkplumber.org
Wed May 29 23:51:37 CEST 2024


On Tue, 28 May 2024 14:12:59 +0800
Fengnan Chang <changfengnan at bytedance.com> wrote:

> If we have a lot of huge pages in system, the memory init will
> cost long time in legacy-mem mode. For example, we have 120G memory
> in unit of 2MB hugepage, the env init will cost 43s. Almost half
> of time spent on find_numasocket, since the address in
> /proc/self/numa_maps is orderd, we can sort hugepg_tbl by orig_va
> first and then just read numa_maps line by line is enough to find
> socket. In my test, spent time reduced to 19s.
> 
> Signed-off-by: Fengnan Chang <changfengnan at bytedance.com>
> ---

Good speed up, but you could do much better if the code only read
/proc/self/numa_maps once and constructed an internal table.
Could use a hash or tree to store the relatively small table.


More information about the dev mailing list