Go to file
Ilya Maximets 1b72605d24 mem: balanced allocation of hugepages
Currently EAL allocates hugepages one by one not paying attention
from which NUMA node allocation was done.

Such behaviour leads to allocation failure if number of available
hugepages for application limited by cgroups or hugetlbfs and
memory requested not only from the first socket.

Example:
	# 90 x 1GB hugepages availavle in a system

	cgcreate -g hugetlb:/test
	# Limit to 32GB of hugepages
	cgset -r hugetlb.1GB.limit_in_bytes=34359738368 test
	# Request 4GB from each of 2 sockets
	cgexec -g hugetlb:test testpmd --socket-mem=4096,4096 ...

	EAL: SIGBUS: Cannot mmap more hugepages of size 1024 MB
	EAL: 32 not 90 hugepages of size 1024 MB allocated
	EAL: Not enough memory available on socket 1!
	     Requested: 4096MB, available: 0MB
	PANIC in rte_eal_init():
	Cannot init memory

	This happens beacause all allocated pages are
	on socket 0.

Fix this issue by setting mempolicy MPOL_PREFERRED for each hugepage
to one of requested nodes using following schema:

	1) Allocate essential hugepages:
		1.1) Allocate as many hugepages from numa N to
		     only fit requested memory for this numa.
		1.2) repeat 1.1 for all numa nodes.
	2) Try to map all remaining free hugepages in a round-robin
	   fashion.
	3) Sort pages and choose the most suitable.

In this case all essential memory will be allocated and all remaining
pages will be fairly distributed between all requested nodes.

New config option RTE_EAL_NUMA_AWARE_HUGEPAGES introduced and
enabled by default for linuxapp except armv7 and dpaa2.
Enabling of this option adds libnuma as a dependency for EAL.

Fixes: 77988fc08d ("mem: fix allocating all free hugepages")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2017-06-30 17:54:32 +02:00
app app/crypto-perf: fix error message 2017-06-28 19:59:22 +02:00
buildtools mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
config mem: balanced allocation of hugepages 2017-06-30 17:54:32 +02:00
devtools mem: balanced allocation of hugepages 2017-06-30 17:54:32 +02:00
doc crypto/scheduler: remove deprecated functions 2017-06-28 21:51:51 +02:00
drivers crypto/scheduler: remove deprecated functions 2017-06-28 21:51:51 +02:00
examples examples/l2fwd-crypto: fix auth info display 2017-06-28 19:59:22 +02:00
lib mem: balanced allocation of hugepages 2017-06-30 17:54:32 +02:00
mk mem: balanced allocation of hugepages 2017-06-30 17:54:32 +02:00
pkg version: 17.05.0 2017-05-11 03:11:34 +02:00
test test/crypto: fix overflow 2017-06-28 20:08:38 +02:00
usertools usertools: add Cavium pkx as network device 2017-05-07 14:32:17 +02:00
.gitattributes improve git diff 2016-11-13 15:25:12 +01:00
.gitignore devtools: add tags and cscope index generation 2017-04-30 12:57:04 +02:00
GNUmakefile mk: do not build tests by default 2017-02-28 16:04:18 +01:00
LICENSE.GPL doc: GPL/LGPL licenses 2013-07-25 14:43:06 +02:00
LICENSE.LGPL doc: fix file format (dos to unix) 2013-09-06 11:43:07 +02:00
MAINTAINERS maintainers: update for i40e 2017-06-30 15:59:34 +02:00
Makefile remove trailing whitespaces 2014-06-11 00:29:34 +02:00
README doc: add readme file 2015-12-13 22:06:58 +01:00

DPDK is a set of libraries and drivers for fast packet processing.
It supports many processor architectures and both FreeBSD and Linux.

The DPDK uses the Open Source BSD license for the core libraries and
drivers. The kernel components are GPLv2 licensed.

Please check the doc directory for release notes,
API documentation, and sample application information.

For questions and usage discussions, subscribe to: users@dpdk.org
Report bugs and issues to the development mailing list: dev@dpdk.org