====================================================
From 10ebc74eda2c3fe9e5a34815e0f7ee1f44d99aa3 Mon Sep 17 00:00:00 2001
From: Liran Zvibel <liran@weka.io>
Date: Sat, 10 Jan 2015 12:46:54 +0200
Subject: [PATCH] Add an option to allocate huge pages in contiunous virtual
addresses
To: dev@dpdk.org
Add a configuration option: CONFIG_RTE_EAL_HUGEPAGES_SINGLE_CONT_VADDR
that advises the memory sengment allocation code to allocate as many
hugemages in a continuous way in virtual addresses as possible.
This way, a mempool may be created out of disparsed memzones allocated
from these new continuos memory segments.
---
lib/librte_eal/linuxapp/eal/eal_memory.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -329,6 +329,7 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl,
#ifndef RTE_EAL_SINGLE_FILE_SEGMENTS
else if (vma_len == 0) {
+#ifndef RTE_EAL_HUGEPAGES_SINGLE_CONT_VADDR
unsigned j, num_pages;
/* reserve a virtual area for next contiguous
@@ -340,6 +341,14 @@ map_all_hugepages(struct hugepage_file *hugepg_tbl,
break;
}
num_pages = j - i;
+#else // hugepages are will be allocated in a continous virtual address way
+ unsigned num_pages;
+ /* We will reserve a virtual area large enough
to fit ALL
+ * physical blocks.
+ * This way we can have bigger mempools even
if there is no
+ * continuos physcial region.
*/
+ num_pages = hpi->num_pages[0] - i;
+#endif