mem: allocate in reverse to reduce fragmentation
authorAnatoly Burakov <anatoly.burakov@intel.com>
Mon, 11 Jun 2018 20:55:42 +0000 (21:55 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 13 Jul 2018 09:04:53 +0000 (11:04 +0200)
commit179f916e88e4a0fdd5ad4d20e226771d3d271c41
tree34419b0101d4b5f1b3d758c6bea05a4be3e2f9ee
parent7985860c18af4947c97a49c37ae3463a3007e310
mem: allocate in reverse to reduce fragmentation

Currently, all hugepages are allocated from lower VA address to
higher VA address, while malloc heap allocates from higher VA
address to lower VA address. This results in heap fragmentation
over time due to multiple reserves leaving small space below the
allocated elements.

Fix this by allocating VA memory from the top, thereby reducing
fragmentation and lowering overall memory usage.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/linuxapp/eal/eal_memalloc.c