From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 4A18B42EA1;
	Tue, 18 Jul 2023 04:48:40 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id CE10A42D33;
	Tue, 18 Jul 2023 04:48:26 +0200 (CEST)
Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189])
 by mails.dpdk.org (Postfix) with ESMTP id 73A9342B8C
 for <dev@dpdk.org>; Tue, 18 Jul 2023 04:48:20 +0200 (CEST)
Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.53])
 by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4R4jxW52h1zLnjN;
 Tue, 18 Jul 2023 10:45:51 +0800 (CST)
Received: from localhost.localdomain (10.50.163.32) by
 dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.27; Tue, 18 Jul 2023 10:48:17 +0800
From: Chengwen Feng <fengchengwen@huawei.com>
To: <thomas@monjalon.net>, <david.marchand@redhat.com>
CC: <dev@dpdk.org>, <mb@smartsharesystems.com>, <anatoly.burakov@intel.com>,
 <dmitry.kozliuk@gmail.com>, <jerinjacobk@gmail.com>, <hofors@lysator.liu.se>, 
 <stephen@networkplumber.org>
Subject: [PATCH v17 0/6] introduce memarea library
Date: Tue, 18 Jul 2023 02:40:00 +0000
Message-ID: <20230718024006.2154-1-fengchengwen@huawei.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20220721044648.6817-1-fengchengwen@huawei.com>
References: <20220721044648.6817-1-fengchengwen@huawei.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-Originating-IP: [10.50.163.32]
X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To
 dggpeml100024.china.huawei.com (7.185.36.115)
X-CFilter-Loop: Reflected
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

The memarea library is an allocator of variable-size object which based
on a memory region. The main features are as follows:

- The memory region can be initialized from the following memory
  sources:
  1. HEAP: e.g. invoke rte_malloc_socket.
  2. LIBC: e.g. invoke posix_memalign.
  3. Another memarea: it can be from another memarea.

- It supports MT-safe as long as it's specified at creation time.

- The address returned by the allocator is align to 8B.

Note:
a) The memarea is oriented towards the application layer, which could
provides 'region-based memory management' [1] function.
b) The eal library also provide memory zone/heap management, but these
are tied to huge pages management.

[1] https://en.wikipedia.org/wiki/Region-based_memory_management

Chengwen Feng (6):
  memarea: introduce memarea library
  test/memarea: support memarea test
  memarea: support alloc and free API
  test/memarea: support alloc and free API test
  memarea: support dump API
  test/memarea: support dump API test

---
v17:
* address Anatoly's comments: add note and enum for cookie and typo.
v16:
* fix compile failed when clang with thread-safety-analysis
  (by disable annotate_locks in lib/memarea/meson.build).
* add reserved field for 'struct rte_memarea_param' which address
  Stephen's comments.
* fix typo.
v15:
* rebase 23.07
* address Anatoly's mostly comments: use rte_errno, abstract cookie
  helper, more comment about critical function, rename add with split,
  doc limitation.
v14:
* address Stephen's comments: RTE_MEMAREA_LOG use easy impl and add
  __func__ print.
v13:
* address Morten's comments: make debug cookies optional, controlled
  by RTE_LIBRTE_MEMAREA_DEBUG; disabled by default.
* reduce management data overhead.
v12:
* remove rte_memarea_refcnt_update() API which address Dongdong's
  comments.
* refine the variable naming.
* fix some bugs.
v11:
* rebase 23.03
* remove "app/test: add memarea to malloc-perf-autotest" because the
  two algorithm are not comparable which also address previous
  comments.
v10:
* support windows platform.
* add rte_memarea.libc perftest to malloc-perf-autotest.
v9:
* address Dmitry's comments.
* drop features of SOURCE_USER and backup memarea mechanism.
* rename rte_memarea_update_refcnt to rte_memarea_refcnt_update
  to keep with rte_mbuf_refcnt_update name style.
* fix memarea perftest compile failed at windows platform.
* fix spell warning.
v8:
* address Mattias's comments (rename ALG_DEFAULT with ALG_NEXTFIT).
* small feature patches are combined.
* enhanced backup memory mechanism.
* add memarea to malloc-perf-autotest.
* other tiny naming optimize.
v7:
* repost patches as there are spread over different series in patchwork.
v6:
* address Mattias's comments.
v5:
* fix 09/10 patch spell warning.
v4:
* repost patches as there are spread over different series in patchwork.
v3:
* add memory source of RTE memory.
* add algorithm field to facilitate the introduction of new algorithms.
* fix memarea log don't output problem.
v2:
* fix compile issues reported by dpdk-test-report.
* address Dimitry and Jerin's comments.
* add no MT-safe test.

 MAINTAINERS                            |   6 +
 app/test/meson.build                   |   2 +
 app/test/test_memarea.c                | 391 +++++++++++++++++++++
 doc/api/doxy-api-index.md              |   3 +-
 doc/api/doxy-api.conf.in               |   1 +
 doc/guides/prog_guide/index.rst        |   1 +
 doc/guides/prog_guide/memarea_lib.rst  |  57 +++
 doc/guides/rel_notes/release_23_07.rst |   6 +
 lib/memarea/memarea_private.h          | 126 +++++++
 lib/memarea/meson.build                |  12 +
 lib/memarea/rte_memarea.c              | 467 +++++++++++++++++++++++++
 lib/memarea/rte_memarea.h              | 208 +++++++++++
 lib/memarea/version.map                |  15 +
 lib/meson.build                        |   1 +
 14 files changed, 1295 insertions(+), 1 deletion(-)
 create mode 100644 app/test/test_memarea.c
 create mode 100644 doc/guides/prog_guide/memarea_lib.rst
 create mode 100644 lib/memarea/memarea_private.h
 create mode 100644 lib/memarea/meson.build
 create mode 100644 lib/memarea/rte_memarea.c
 create mode 100644 lib/memarea/rte_memarea.h
 create mode 100644 lib/memarea/version.map

-- 
2.17.1