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 7F1A2A0542; Wed, 5 Oct 2022 05:39:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D37840DDC; Wed, 5 Oct 2022 05:38:59 +0200 (CEST) Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by mails.dpdk.org (Postfix) with ESMTP id 6D11D40041 for ; Wed, 5 Oct 2022 05:38:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1664941134; bh=O/nh9HbKh2AplgaPwirbzlTWP0Gwg0pVYe78zJslN3c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uyonHsTE/m5bh+nWgQ5am9bc9M8k8TcYQVi0m3T6CcgjpmcAMl78yDZ18/pBAQvMT GbZOGuOVc5E4Gz4fJBU2U90FoaJoHvEN0wVw64Vp+/bduYjCDWNOMNCywQktB4SQ7a SPgQoP/HgKLJfqNAJaGj/a0LkHtc7d3tVqCqAnvY= Received: from qq.com ([120.229.93.179]) by newxmesmtplogicsvrszc13.qq.com (NewEsmtp) with SMTP id 9B40FA58; Wed, 05 Oct 2022 11:38:52 +0800 X-QQ-mid: xmsmtpt1664941132t51osqo1y Message-ID: X-QQ-XMAILINFO: Mdc3TkmnJyI/BWPyNCU4MG5AK7GMRabvZbdbvFMiZjSTGlvf8FIAViANUZeCce ik6p0WY/beZk0PvRShi+cgF3SotyH6gjNEAUf67w3GOlTn0qzQlL/tRQBv8+RuDsOJvewaDiys3k v3Nq/M5KoinESIK8RQAKc/Y9Uz86EG0vXB5wXaqaXlixl3HDYlToKaug9syfOBa4swk+Czly2YV9 TYP/6VxxJCXQURZv4rmXGSaUbvKX8VL0OA5f/cFEeIRlzMhHqA7sixhowWrW9VrJeJ57DnIsGB8B AJO71neuIS+a85JEbswgiIKJBrxsB/4Y6GQoBSru4vbjlvv5ooDAwt4LZqQxDedVEr6TPLLLb36U dOW+kk8MZHLP7dGukbhsMZwdaB21OQbdvPyfoqPcvCmkKDKO9AFJayUMTCbVijsXuj8xvV/tdDQW BIiJm7q0ONYHs1hX9z/0DtOKllmURTFgJ9W0Q/YC6594XPGffYO9sfaSPjZIt2Figu9dCHG5Jizx bWqMzIFGcoO0IPXnsLMPO7n1NUjuRflkhpKiMmmhDQNcSddpHkZrR+CgVfnnCpFMcepsME4AtK/0 kblJ/hKt9mWgdr+/uo052NhiAZiX+RpR65BQk6ui3pvVmkqwckJMydljobVhLtM+Pxo72kUwN5B3 kZbU22uM+Q1qvHvikSgGs+7fyPkDnY66J78Et0nECjsPjvSYXRriwQaUenTlG8xvyl7uir61eWhZ OIcNQ6LJeRdV71LUsRBdCHaLViPNsK5ABUCAuMf2rIkK+OQM6qSZXoCLIPNURsAbthutgMfQCwqL E987NubzOWAUiYFaSdksnOMwpORfnl9yzYs+Bupy5L5loFYL51ZBvbdOGSeTeguyh7buda70dxbE WviJonkMTkKPObr5YO33XN53mrmCMXgsV7X5M091YqvgOFyW11hAlPdN5JyWinBJij6SEPUMHetF /U10LvnJ6d6s61CBjWKkzJVU+e1I7D From: datshan To: david.marchand@redhat.com, mb@smartsharesystems.com, anatoly.burakov@intel.com, dmitry.kozliuk@gmail.com, jerinjacobk@gmail.com Cc: thomas@monjalon.net, dev@dpdk.org, datshan , Chengwen Feng Subject: [PATCH v4 00/10] introduce memarea library Date: Wed, 5 Oct 2022 11:38:38 +0800 X-OQ-MSGID: <20221005033848.2241-1-datshan@qq.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220721044648.6817-1-fengchengwen@huawei.com> References: <20220721044648.6817-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 default alignment size is RTE_CACHE_LINE_SIZE. - The memory region can be initialized from the following memory sources: 1. RTE memory: e.g. invoke rte_malloc_socket to obtain. 2. System API: e.g. invoke posix_memalign to obtain. 3. User provided address: it can be from extended memory as long as it is available. The 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. 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 --- 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 | 401 +++++++++++++++++++++++ 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 | 55 ++++ 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 | 430 +++++++++++++++++++++++++ lib/memarea/rte_memarea.h | 229 +++++++++++++ lib/memarea/version.map | 16 + lib/meson.build | 1 + 16 files changed, 1205 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.34.1