From 3eb9af341604fcdfd1cb14d6a7957e0aa88fff02 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Wed, 25 Apr 2018 14:42:55 +0100 Subject: [PATCH 1/1] malloc: fix heap size not set on init When heap initializes, we need to add already allocated segments onto the heap. However, in doing that, we never increased total heap size. Fix it by adding segment length to total heap length when initializing the heap. Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists") Signed-off-by: Anatoly Burakov --- lib/librte_eal/common/malloc_heap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c index 5cf7231022..633e306115 100644 --- a/lib/librte_eal/common/malloc_heap.c +++ b/lib/librte_eal/common/malloc_heap.c @@ -107,6 +107,8 @@ malloc_add_seg(const struct rte_memseg_list *msl, malloc_heap_add_memory(heap, found_msl, ms->addr, len); + heap->total_size += len; + RTE_LOG(DEBUG, EAL, "Added %zuM to heap on socket %i\n", len >> 20, msl->socket_id); return 0; -- 2.20.1