patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ruifeng Wang <ruifeng.wang@arm.com>
To: "Anatoly Burakov" <anatoly.burakov@intel.com>,
	"Fengnan Chang" <changfengnan@bytedance.com>,
	"Morten Brørup" <mb@smartsharesystems.com>
Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, feifei.wang2@arm.com,
	nd@arm.com, Ruifeng Wang <ruifeng.wang@arm.com>,
	stable@dpdk.org
Subject: [PATCH 1/4] eal: fix list index for 256 byte element
Date: Fri, 19 May 2023 12:29:20 +0800	[thread overview]
Message-ID: <20230519042923.314670-2-ruifeng.wang@arm.com> (raw)
In-Reply-To: <20230519042923.314670-1-ruifeng.wang@arm.com>

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 <ruifeng.wang@arm.com>
---
 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


       reply	other threads:[~2023-05-19  4:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230519042923.314670-1-ruifeng.wang@arm.com>
2023-05-19  4:29 ` Ruifeng Wang [this message]
2023-05-19 11:10   ` Burakov, Anatoly
2023-05-19  4:29 ` [PATCH 3/4] test/malloc: fix missing free Ruifeng Wang
2023-05-19 11:08   ` Burakov, Anatoly
2023-05-19  4:29 ` [PATCH 4/4] test/malloc: fix case expectation Ruifeng Wang
2023-05-19 11:07   ` Burakov, Anatoly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230519042923.314670-2-ruifeng.wang@arm.com \
    --to=ruifeng.wang@arm.com \
    --cc=anatoly.burakov@intel.com \
    --cc=changfengnan@bytedance.com \
    --cc=dev@dpdk.org \
    --cc=feifei.wang2@arm.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=mb@smartsharesystems.com \
    --cc=nd@arm.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).