码迷,mamicode.com
首页 > 其他好文 > 详细

DPDK内存初始化失败

时间:2015-12-16 18:50:48      阅读:3791      评论:0      收藏:0      [点我收藏+]

标签:

dpdk应用程序启动失败,信息提示:

Current CONFIG_RTE_MAX_MEMSEG=256 is not enough
Please either increase it or request less amount of memory.
PANIC in rte_eal_init():
Cannot init memory

罪魁祸首是内存碎片,app无法申请到足够多的连续大块内存,只能申请到很多小块内存。以至于内存块数目超过了系统设置的256个。

 

最佳解决办法:

dpdk-getting-started-guide.pdf这个文档的2.3.2节中提到

The allocation of hugepages should be done at boot time or as soon as possible after system boot to prevent memory from being fragmented in physical memory.To reserve hugepages at boot time, a parameter is passed to the Linux* kernel on the kernel command line.

就是申请大页内存应该在系统启动时,或系统启动后尽快申请,避免内存被割裂。

可以在/boot/grub/grub.conf中的kernel行,追加

default_hugepagesz=1G hugepagesz=1G hugepages=4

使用1G的大页,大页内存4G。

 

In the case of a dual-socket NUMA system, the number of hugepages reserved at boot time is generally divided equally between the two sockets (on the assumption that sufficient memory is present on both sockets).

在双槽NUMA系统下,hugepage内存被均分给了两个槽。

DPDK内存初始化失败

标签:

原文地址:http://www.cnblogs.com/yilipika/p/5051767.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!