Message ID | 20220920034643.55476-1-fengchengwen@huawei.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3EEB2A00C3; Tue, 20 Sep 2022 05:53:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B7DD41156; Tue, 20 Sep 2022 05:53:01 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 4022A4021D for <dev@dpdk.org>; Tue, 20 Sep 2022 05:53:00 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MWndP1BbZzHnvr; Tue, 20 Sep 2022 11:50:49 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 20 Sep 2022 11:52:57 +0800 From: Chengwen Feng <fengchengwen@huawei.com> To: <thomas@monjalon.net> CC: <dev@dpdk.org>, <stephen@networkplumber.org>, <jerinjacobk@gmail.com>, <dmitry.kozliuk@gmail.com> Subject: [PATCH 0/8] introduce memarea library Date: Tue, 20 Sep 2022 03:46:35 +0000 Message-ID: <20220920034643.55476-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 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500024.china.huawei.com (7.185.36.10) 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 |
Series |
introduce memarea library
|
|
Message
fengchengwen
Sept. 20, 2022, 3:46 a.m. UTC
The memarea library is an allocator of variable-size object. It is a
collection of allocated objects that can be efficiently alloc or free
all at once, the main feature are as follows:
a) it facilitate alloc and free of memory with low overhead.
b) it provides refcnt feature which could be useful in some scenes.
c) it supports MT-safe as long as it's specified at creation time.
d) it's memory source could comes from:
d.1) system API: malloc in C library.
d.2) user provided address: it can be from the rte_malloc API series
or extended memory as long as it is available.
d.3) user provided memarea: it can be from another memarea.
e) it provides backup memory mechanism, the memarea object could use
another memarea object as a backup.
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
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Chengwen Feng (8):
memarea: introduce memory area library
test/memarea: support memarea test
memarea: support alloc/free/update-refcnt API
test/memarea: support alloc/free/update-refcnt test
memarea: support dump API
test/memarea: support dump test
memarea: support backup memory mechanism
test/memarea: support backup memory test
MAINTAINERS | 6 +
app/test/meson.build | 2 +
app/test/test_memarea.c | 340 ++++++++++++++++++++++
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_22_11.rst | 6 +
lib/eal/include/rte_log.h | 1 +
lib/memarea/memarea_private.h | 35 +++
lib/memarea/meson.build | 16 +
lib/memarea/rte_memarea.c | 385 +++++++++++++++++++++++++
lib/memarea/rte_memarea.h | 214 ++++++++++++++
lib/memarea/version.map | 16 +
lib/meson.build | 1 +
15 files changed, 1083 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