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 09D99A0542; Sat, 8 Oct 2022 13:39:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06C8142BBB; Sat, 8 Oct 2022 13:39:31 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id CC66142BB3 for ; Sat, 8 Oct 2022 13:39:29 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Ml34Y3R4czlXbq; Sat, 8 Oct 2022 19:34:53 +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; Sat, 8 Oct 2022 19:39:23 +0800 From: Chengwen Feng To: , , , , , CC: , , Subject: [PATCH v6 00/10] introduce memarea library Date: Sat, 8 Oct 2022 11:33:33 +0000 Message-ID: <20221008113343.30577-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: dggems704-chm.china.huawei.com (10.3.19.181) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 allocated object aligned at RTE_CACHE_LINE_SIZE default. - 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. User provided: it can be from e.g. rte_extmem_xxx as long as it is available. The memory's start address must be aligned to RTE_CACHE_LINE_SIZE. 4. User provided memarea: it can be from another memarea. - It provides refcnt feature which could be useful in multi-reader scenario. - It provides backup memory mechanism, the memarea could use another memarea as a backup. It will attempts to allocate object from backup memarea when the current memarea failed to allocate. 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 Chengwen Feng (10): memarea: introduce memarea 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 memarea: detect memory corruption based on magic test/memarea: support no MT-safe test --- 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 | 420 ++++++++++++++++++++++++ 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 | 56 ++++ doc/guides/rel_notes/release_22_11.rst | 6 + lib/eal/common/eal_common_log.c | 1 + lib/eal/include/rte_log.h | 1 + lib/memarea/memarea_private.h | 37 +++ lib/memarea/meson.build | 16 + lib/memarea/rte_memarea.c | 428 +++++++++++++++++++++++++ lib/memarea/rte_memarea.h | 234 ++++++++++++++ lib/memarea/version.map | 16 + lib/meson.build | 1 + 16 files changed, 1228 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