From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BEB0242B43; Fri, 19 May 2023 06:30:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B17A642B8B; Fri, 19 May 2023 06:30:14 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id D269E406B5; Fri, 19 May 2023 06:30:13 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2EA1A1FB; Thu, 18 May 2023 21:30:58 -0700 (PDT) Received: from net-arm-n1amp-02.shanghai.arm.com (net-arm-n1amp-02.shanghai.arm.com [10.169.210.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 73D433F762; Thu, 18 May 2023 21:30:10 -0700 (PDT) From: Ruifeng Wang To: Anatoly Burakov , Fengnan Chang , =?UTF-8?q?Morten=20Br=C3=B8rup?= Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, feifei.wang2@arm.com, nd@arm.com, Ruifeng Wang , stable@dpdk.org Subject: [PATCH 1/4] eal: fix list index for 256 byte element Date: Fri, 19 May 2023 12:29:20 +0800 Message-Id: <20230519042923.314670-2-ruifeng.wang@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230519042923.314670-1-ruifeng.wang@arm.com> References: <20230519042923.314670-1-ruifeng.wang@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Elements with 2^8B size should fall into index 1 of the list. Fixes: f62f4a375ff4 ("malloc: optimize 4K allocations") Cc: changfengnan@bytedance.com Cc: stable@dpdk.org Signed-off-by: Ruifeng Wang --- lib/eal/common/malloc_elem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c index 35a2313d04..619c040aa3 100644 --- a/lib/eal/common/malloc_elem.c +++ b/lib/eal/common/malloc_elem.c @@ -382,7 +382,7 @@ malloc_elem_free_list_index(size_t size) size_t log2; size_t index; - if (size <= (1UL << MALLOC_MINSIZE_LOG2)) + if (size < (1UL << MALLOC_MINSIZE_LOG2)) return 0; /* Find next power of 2 > size. */ -- 2.25.1