Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/118240/?format=api
http://patches.dpdk.org/api/patches/118240/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221017034058.34176-8-fengchengwen@huawei.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20221017034058.34176-8-fengchengwen@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20221017034058.34176-8-fengchengwen@huawei.com", "date": "2022-10-17T03:40:58", "name": "[v10,7/7] app/test: add memarea to malloc-perf-autotest", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "40ef18c1e22ff0e5ac3c82ea5b83c85a8b4b2af4", "submitter": { "id": 2146, "url": "http://patches.dpdk.org/api/people/2146/?format=api", "name": "fengchengwen", "email": "fengchengwen@huawei.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221017034058.34176-8-fengchengwen@huawei.com/mbox/", "series": [ { "id": 25245, "url": "http://patches.dpdk.org/api/series/25245/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25245", "date": "2022-10-17T03:40:51", "name": "introduce memarea library", "version": 10, "mbox": "http://patches.dpdk.org/series/25245/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/118240/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/118240/checks/", "tags": {}, "related": [], "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 14F62A0556;\n\tMon, 17 Oct 2022 05:47:34 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 435204282E;\n\tMon, 17 Oct 2022 05:46:58 +0200 (CEST)", "from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188])\n by mails.dpdk.org (Postfix) with ESMTP id 1633640143\n for <dev@dpdk.org>; Mon, 17 Oct 2022 05:46:50 +0200 (CEST)", "from dggpeml500024.china.huawei.com (unknown [172.30.72.56])\n by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MrNGB4dqqzHvh1;\n Mon, 17 Oct 2022 11:46:42 +0800 (CST)", "from localhost.localdomain (10.67.165.24) by\n dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2375.31; Mon, 17 Oct 2022 11:46:46 +0800" ], "From": "Chengwen Feng <fengchengwen@huawei.com>", "To": "<david.marchand@redhat.com>, <mb@smartsharesystems.com>,\n <anatoly.burakov@intel.com>, <dmitry.kozliuk@gmail.com>,\n <jerinjacobk@gmail.com>, <hofors@lysator.liu.se>", "CC": "<thomas@monjalon.net>, <dev@dpdk.org>", "Subject": "[PATCH v10 7/7] app/test: add memarea to malloc-perf-autotest", "Date": "Mon, 17 Oct 2022 03:40:58 +0000", "Message-ID": "<20221017034058.34176-8-fengchengwen@huawei.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20221017034058.34176-1-fengchengwen@huawei.com>", "References": "<20220721044648.6817-1-fengchengwen@huawei.com>\n <20221017034058.34176-1-fengchengwen@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.67.165.24]", "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n 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>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "This patch adds memarea perftest to malloc_perf_autotest.\n\nThe memarea perftest contains two part:\n1) rte_memarea.heap: the memory source comes from invoking\nrte_malloc_socket().\n2) rte_memarea.libc: the memory source comes from invoking malloc().\n\nTest platform: Kunpeng920\nTest command: dpdk-test -a 0000:7d:00.3 -l 10-12\nTest result:\nUSER1: Performance: rte_memarea.heap\nUSER1: Size (B) Runs Alloc (us) Free (us) Total (us) memset (us)\nUSER1: 64 10000 0.04 0.04 0.08 0.01\nUSER1: 128 10000 0.03 0.03 0.06 0.01\nUSER1: 1024 10000 0.03 0.04 0.07 0.20\nUSER1: 4096 10000 0.03 0.05 0.08 0.34\nUSER1: 65536 10000 0.10 0.06 0.16 2.15\nUSER1: 1048576 1023 0.11 0.04 0.15 29.15\nUSER1: 2097152 511 0.12 0.04 0.16 57.72\nUSER1: 4194304 255 0.14 0.04 0.17 114.93\nUSER1: 16777216 63 0.15 0.07 0.21 457.51\nUSER1: 1073741824 Interrupted: out of memory.\n\nUSER1: Performance: rte_memarea.libc\nUSER1: Size (B) Runs Alloc (us) Free (us) Total (us) memset (us)\nUSER1: 64 10000 0.12 0.03 0.15 0.01\nUSER1: 128 10000 0.03 0.03 0.06 0.01\nUSER1: 1024 10000 0.15 0.04 0.19 0.19\nUSER1: 4096 10000 0.51 0.04 0.54 0.34\nUSER1: 65536 10000 9.40 0.06 9.46 2.14\nUSER1: 1048576 1023 48.39 0.07 48.46 29.15\nUSER1: 2097152 511 0.11 0.06 0.17 57.79\nUSER1: 4194304 255 0.11 0.06 0.18 114.82\nUSER1: 16777216 63 0.12 0.07 0.19 457.86\nUSER1: 1073741824 Interrupted: out of memory.\n\nCompared with rte_malloc:\nUSER1: Performance: rte_malloc\nUSER1: Size (B) Runs Alloc (us) Free (us) Total (us) memset (us)\nUSER1: 64 10000 0.14 0.07 0.21 0.01\nUSER1: 128 10000 0.10 0.05 0.15 0.01\nUSER1: 1024 10000 0.11 0.18 0.29 0.21\nUSER1: 4096 10000 0.13 0.39 0.53 0.35\nUSER1: 65536 10000 0.17 2.27 2.44 2.15\nUSER1: 1048576 10000 37.21 71.63 108.84 29.08\nUSER1: 2097152 10000 8831.15 160.02 8991.17 63.52\nUSER1: 4194304 10000 47131.88 413.75 47545.62 173.79\nUSER1: 16777216 4221 119604.60 2209.73 121814.34 964.42\nUSER1: 1073741824 31 335058.32 223369.31 558427.63 62440.87\n\nNote: The rte_malloc time includes obtaining memory from the system,\nbut rte_memarea time don't includes these (it uses pre-allocated\npolicy).\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n app/test/test_malloc_perf.c | 82 +++++++++++++++++++++++++++++++++++++\n 1 file changed, 82 insertions(+)", "diff": "diff --git a/app/test/test_malloc_perf.c b/app/test/test_malloc_perf.c\nindex ccec43ae84..0972f4dec7 100644\n--- a/app/test/test_malloc_perf.c\n+++ b/app/test/test_malloc_perf.c\n@@ -7,6 +7,7 @@\n #include <rte_cycles.h>\n #include <rte_errno.h>\n #include <rte_malloc.h>\n+#include <rte_memarea.h>\n #include <rte_memzone.h>\n \n #include \"test.h\"\n@@ -20,6 +21,8 @@ typedef void * (memset_t)(void *addr, int value, size_t size);\n static const uint64_t KB = 1 << 10;\n static const uint64_t GB = 1 << 30;\n \n+static struct rte_memarea *ma_perftest_handle;\n+\n static double\n tsc_to_us(uint64_t tsc, size_t runs)\n {\n@@ -147,6 +150,80 @@ memzone_free(void *addr)\n \trte_memzone_free((struct rte_memzone *)addr);\n }\n \n+static const char *\n+memarea_perftest_source_name(enum rte_memarea_source source)\n+{\n+\tif (source == RTE_MEMAREA_SOURCE_HEAP)\n+\t\treturn \"heap\";\n+\telse if (source == RTE_MEMAREA_SOURCE_LIBC)\n+\t\treturn \"libc\";\n+\telse\n+\t\treturn \"unknown\";\n+}\n+\n+static int\n+memarea_perftest_pre_env(enum rte_memarea_source source)\n+{\n+\tstruct rte_memarea_param init;\n+\n+\tmemset(&init, 0, sizeof(init));\n+\tsnprintf(init.name, sizeof(init.name), \"perftest\");\n+\tinit.source = source;\n+\tinit.alg = RTE_MEMAREA_ALG_NEXTFIT;\n+\tinit.total_sz = GB;\n+\tinit.mt_safe = 1;\n+\tinit.numa_socket = SOCKET_ID_ANY;\n+\n+\tma_perftest_handle = rte_memarea_create(&init);\n+\tif (ma_perftest_handle == NULL) {\n+\t\tfprintf(stderr, \"memarea create failed, skip memarea source: %s perftest!\\n\",\n+\t\t\tmemarea_perftest_source_name(source));\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n+static void\n+memarea_perftest_clear_env(void)\n+{\n+\trte_memarea_destroy(ma_perftest_handle);\n+\tma_perftest_handle = NULL;\n+}\n+\n+static void *\n+memarea_perftest_alloc(const char *name, size_t size, unsigned int align)\n+{\n+\tRTE_SET_USED(name);\n+\tRTE_SET_USED(align);\n+\treturn rte_memarea_alloc(ma_perftest_handle, size, 0);\n+}\n+\n+static void\n+memarea_perftest_free(void *addr)\n+{\n+\trte_memarea_free(ma_perftest_handle, addr);\n+}\n+\n+static int\n+memarea_perftest(enum rte_memarea_source source, double memset_gb_us, size_t max_runs)\n+{\n+\tchar test_name[64] = { 0 };\n+\n+\tif (memarea_perftest_pre_env(source) < 0)\n+\t\treturn 0;\n+\n+\tsnprintf(test_name, sizeof(test_name), \"rte_memarea.%s\",\n+\t\t memarea_perftest_source_name(source));\n+\tif (test_alloc_perf(test_name, memarea_perftest_alloc, memarea_perftest_free,\n+\t\t\tmemset, memset_gb_us, max_runs) < 0) {\n+\t\tmemarea_perftest_clear_env();\n+\t\treturn -1;\n+\t}\n+\n+\tmemarea_perftest_clear_env();\n+\treturn 0;\n+}\n+\n static int\n test_malloc_perf(void)\n {\n@@ -168,6 +245,11 @@ test_malloc_perf(void)\n \t\t\tNULL, memset_us_gb, RTE_MAX_MEMZONE - 1) < 0)\n \t\treturn -1;\n \n+\tif (memarea_perftest(RTE_MEMAREA_SOURCE_HEAP, memset_us_gb, MAX_RUNS) < 0)\n+\t\treturn -1;\n+\tif (memarea_perftest(RTE_MEMAREA_SOURCE_LIBC, memset_us_gb, MAX_RUNS) < 0)\n+\t\treturn -1;\n+\n \treturn 0;\n }\n \n", "prefixes": [ "v10", "7/7" ] }{ "id": 118240, "url": "