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 5F68942925; Wed, 12 Apr 2023 10:44:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03ABA40FAE; Wed, 12 Apr 2023 10:44:19 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id C2D574067B for ; Wed, 12 Apr 2023 10:44:16 +0200 (CEST) Received: from dggpeml100020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PxGQq4l6MzKyFL for ; Wed, 12 Apr 2023 16:41:39 +0800 (CST) Received: from dggpeml500021.china.huawei.com (7.185.36.21) by dggpeml100020.china.huawei.com (7.185.36.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 12 Apr 2023 16:44:14 +0800 Received: from dggpeml500021.china.huawei.com ([7.185.36.21]) by dggpeml500021.china.huawei.com ([7.185.36.21]) with mapi id 15.01.2507.023; Wed, 12 Apr 2023 16:44:14 +0800 From: "wuchangsheng (C)" To: "anatoly.burakov@intel.com" CC: "dev@dpdk.org" , "jiangheng (G)" , "Yanan (Euler)" , "Suweifeng (Weifeng, EulerOS)" Subject: [DPDK] heap memory fragmentation issue Thread-Topic: [DPDK] heap memory fragmentation issue Thread-Index: AdltGnbHkADfDfN2S9CgD+rz+TFNnw== Date: Wed, 12 Apr 2023 08:44:14 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.136.112.45] Content-Type: multipart/alternative; boundary="_000_ba5b1a9815394b868b3fac8f4e1f3b27huaweicom_" MIME-Version: 1.0 X-CFilter-Loop: Reflected 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 --_000_ba5b1a9815394b868b3fac8f4e1f3b27huaweicom_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello: When using rte_malloc and rte_free to request and release memory repeat= edly, the usage of large pages gradually increases. Checking the relevant source code shows that memory requests and releases a= re started from the head of the freelist chain list of the heap. Memory fra= gmentation seems to result from this, which is considered because the memor= y recently released may be in the cache, and requesting this memory at the = time of allocation may achieve higher performance? How does the community consider the heap's memory fragmentation issue? Is t= here a future plan for memory fragmentation optimization? --_000_ba5b1a9815394b868b3fac8f4e1f3b27huaweicom_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello:

    When using rte_malloc and rte_fr= ee to request and release memory repeatedly, the usage of large pages gradu= ally increases.

Checking the relevant = source code shows that memory requests and releases are started from the he= ad of the freelist chain list of the heap. Memory fragmentation seems to re= sult from this, which is considered because the memory recently released may be in the cache, and requesting t= his memory at the time of allocation may achieve higher performance?

How does the community= consider the heap's memory fragmentation issue? Is there a future plan for= memory fragmentation optimization?

--_000_ba5b1a9815394b868b3fac8f4e1f3b27huaweicom_--