Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/51903/?format=api
http://patches.dpdk.org/api/patches/51903/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1553856998-25394-3-git-send-email-phil.yang@arm.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": "<1553856998-25394-3-git-send-email-phil.yang@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1553856998-25394-3-git-send-email-phil.yang@arm.com", "date": "2019-03-29T10:56:37", "name": "[v2,2/3] test/distributor: replace sync builtins with atomic builtins", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "911f1e3790699be1f409fdca0942cf932a40f0d4", "submitter": { "id": 833, "url": "http://patches.dpdk.org/api/people/833/?format=api", "name": "Phil Yang", "email": "phil.yang@arm.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/1553856998-25394-3-git-send-email-phil.yang@arm.com/mbox/", "series": [ { "id": 3993, "url": "http://patches.dpdk.org/api/series/3993/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3993", "date": "2019-03-29T10:56:35", "name": "example and test cases optimizations", "version": 2, "mbox": "http://patches.dpdk.org/series/3993/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/51903/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/51903/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9D5274C9D;\n\tFri, 29 Mar 2019 11:57:00 +0100 (CET)", "from foss.arm.com (foss.arm.com [217.140.101.70])\n\tby dpdk.org (Postfix) with ESMTP id 5B7EA4C94\n\tfor <dev@dpdk.org>; Fri, 29 Mar 2019 11:56:55 +0100 (CET)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BDE4780D;\n\tFri, 29 Mar 2019 03:56:54 -0700 (PDT)", "from phil-VirtualBox.shanghai.arm.com (unknown [10.169.106.173])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id\n\t43EF33F575; Fri, 29 Mar 2019 03:56:53 -0700 (PDT)" ], "From": "Phil Yang <phil.yang@arm.com>", "To": "dev@dpdk.org,\n\tthomas@monjalon.net", "Cc": "david.hunt@intel.com, reshma.pattan@intel.com, gavin.hu@arm.com,\n\thonnappa.nagarahalli@arm.com, phil.yang@arm.com, nd@arm.com", "Date": "Fri, 29 Mar 2019 18:56:37 +0800", "Message-Id": "<1553856998-25394-3-git-send-email-phil.yang@arm.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": [ "<1553856998-25394-1-git-send-email-phil.yang@arm.com>", "<1546508946-12552-1-git-send-email-phil.yang@arm.com>" ], "References": [ "<1553856998-25394-1-git-send-email-phil.yang@arm.com>", "<1546508946-12552-1-git-send-email-phil.yang@arm.com>" ], "Subject": "[dpdk-dev] [PATCH v2 2/3] test/distributor: replace sync builtins\n\twith atomic builtins", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "'__sync' built-in functions are deprecated, should use the '__atomic'\nbuilt-in instead. the sync built-in functions are full barriers, while\natomic built-in functions offer less restrictive one-way barriers,\nwhich help performance.\n\nHere is the example test result on TX2:\nsudo ./arm64-armv8a-linuxapp-gcc/app/test -l 112-139 \\\n-n 4 --socket-mem=1024,1024 -- -i\nRTE>>distributor_perf_autotest\n\n*** distributor_perf_autotest without this patch ***", "diff": "==== Cache line switch test ===\nTime for 33554432 iterations = 1519202730 ticks\nTicks per iteration = 45\n\n*** distributor_perf_autotest with this patch ***\n==== Cache line switch test ===\nTime for 33554432 iterations = 1251715496 ticks\nTicks per iteration = 37\n\nLess ticks needed for the cache line switch test. It got 17% of\nperformance improvement.\n\nSigned-off-by: Phil Yang <phil.yang@arm.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Joyce Kong <joyce.kong@arm.com>\nReviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\n---\n app/test/test_distributor.c | 18 +++++++++++++++++-\n app/test/test_distributor_perf.c | 7 ++++++-\n 2 files changed, 23 insertions(+), 2 deletions(-)\n\ndiff --git a/app/test/test_distributor.c b/app/test/test_distributor.c\nindex 98919ec..ddab08d 100644\n--- a/app/test/test_distributor.c\n+++ b/app/test/test_distributor.c\n@@ -62,9 +62,14 @@ handle_work(void *arg)\n \tstruct worker_params *wp = arg;\n \tstruct rte_distributor *db = wp->dist;\n \tunsigned int count = 0, num = 0;\n-\tunsigned int id = __sync_fetch_and_add(&worker_idx, 1);\n \tint i;\n \n+#ifdef RTE_USE_C11_MEM_MODEL\n+\tunsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);\n+#else\n+\tunsigned int id = __sync_fetch_and_add(&worker_idx, 1);\n+#endif\n+\n \tfor (i = 0; i < 8; i++)\n \t\tbuf[i] = NULL;\n \tnum = rte_distributor_get_pkt(db, id, buf, buf, num);\n@@ -270,7 +275,12 @@ handle_work_with_free_mbufs(void *arg)\n \tunsigned int count = 0;\n \tunsigned int i;\n \tunsigned int num = 0;\n+\n+#ifdef RTE_USE_C11_MEM_MODEL\n+\tunsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);\n+#else\n \tunsigned int id = __sync_fetch_and_add(&worker_idx, 1);\n+#endif\n \n \tfor (i = 0; i < 8; i++)\n \t\tbuf[i] = NULL;\n@@ -343,7 +353,13 @@ handle_work_for_shutdown_test(void *arg)\n \tunsigned int total = 0;\n \tunsigned int i;\n \tunsigned int returned = 0;\n+\n+#ifdef RTE_USE_C11_MEM_MODEL\n+\tconst unsigned int id = __atomic_fetch_add(&worker_idx, 1,\n+\t\t\t__ATOMIC_RELAXED);\n+#else\n \tconst unsigned int id = __sync_fetch_and_add(&worker_idx, 1);\n+#endif\n \n \tnum = rte_distributor_get_pkt(d, id, buf, buf, num);\n \ndiff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c\nindex edf1998..9367460 100644\n--- a/app/test/test_distributor_perf.c\n+++ b/app/test/test_distributor_perf.c\n@@ -111,9 +111,14 @@ handle_work(void *arg)\n \tunsigned int count = 0;\n \tunsigned int num = 0;\n \tint i;\n-\tunsigned int id = __sync_fetch_and_add(&worker_idx, 1);\n \tstruct rte_mbuf *buf[8] __rte_cache_aligned;\n \n+#ifdef RTE_USE_C11_MEM_MODEL\n+\tunsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED);\n+#else\n+\tunsigned int id = __sync_fetch_and_add(&worker_idx, 1);\n+#endif\n+\n \tfor (i = 0; i < 8; i++)\n \t\tbuf[i] = NULL;\n \n", "prefixes": [ "v2", "2/3" ] }{ "id": 51903, "url": "