From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 62FDC160; Sun, 7 Oct 2018 21:40:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2018 12:40:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,354,1534834800"; d="scan'208";a="86457971" Received: from violet.igk.intel.com ([10.102.54.177]) by FMSMGA003.fm.intel.com with ESMTP; 07 Oct 2018 12:40:36 -0700 From: Darek Stojaczyk To: dev@dpdk.org Cc: Darek Stojaczyk , anatoly.burakov@intel.com, stable@dpdk.org Date: Sun, 7 Oct 2018 21:31:47 +0200 Message-Id: <20181007193147.123868-1-dariusz.stojaczyk@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] malloc: respect SIZE_HINT_ONLY when looking for the biggest free elem X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2018 19:40:48 -0000 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: anatoly.burakov@intel.com Cc: stable@dpdk.org Signed-off-by: Darek Stojaczyk --- lib/librte_eal/common/malloc_heap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c index ac7bbb3ba..d2a8bd8dc 100644 --- a/lib/librte_eal/common/malloc_heap.c +++ b/lib/librte_eal/common/malloc_heap.c @@ -165,7 +165,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 = -- 2.17.1