summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDarek Stojaczyk <dariusz.stojaczyk@intel.com>2018-10-07 21:31:47 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-10-28 11:59:02 +0100
commitc7810c319d5f70c7d3c1b878f9431dc17dc1b6bc (patch)
treec12617d37200a6b9c0fc88c87951c05d7f3726d1 /lib
parente4f2c1421d8036a4778c43bf25201ef5fb37ad6f (diff)
downloaddpdk-c7810c319d5f70c7d3c1b878f9431dc17dc1b6bc.zip
dpdk-c7810c319d5f70c7d3c1b878f9431dc17dc1b6bc.tar.gz
dpdk-c7810c319d5f70c7d3c1b878f9431dc17dc1b6bc.tar.xz
malloc: check size hint when reserving the biggest element
RTE_MEMZONE_SIZE_HINT_ONLY wasn't checked in any way, causing size hints to be parsed as hard requirements. This resulted in some allocations being failed prematurely. Fixes: 68b6092bd3c7 ("malloc: allow reserving biggest element") Cc: stable@dpdk.org Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_eal/common/malloc_heap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c
index 08ec753..363f306 100644
--- a/lib/librte_eal/common/malloc_heap.c
+++ b/lib/librte_eal/common/malloc_heap.c
@@ -192,7 +192,9 @@ find_biggest_element(struct malloc_heap *heap, size_t *size,
for (elem = LIST_FIRST(&heap->free_head[idx]);
!!elem; elem = LIST_NEXT(elem, free_list)) {
size_t cur_size;
- if (!check_hugepage_sz(flags, elem->msl->page_sz))
+ if ((flags & RTE_MEMZONE_SIZE_HINT_ONLY) == 0 &&
+ !check_hugepage_sz(flags,
+ elem->msl->page_sz))
continue;
if (contig) {
cur_size =