Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/44781/?format=api
http://patches.dpdk.org/api/patches/44781/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1537172244-64874-3-git-send-email-gavin.hu@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": "<1537172244-64874-3-git-send-email-gavin.hu@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1537172244-64874-3-git-send-email-gavin.hu@arm.com", "date": "2018-09-17T08:17:24", "name": "[v3,3/3] ring: move the atomic load of head above the loop", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "4948fbdeaec858e90133fc4faf1412740ec580f0", "submitter": { "id": 1018, "url": "http://patches.dpdk.org/api/people/1018/?format=api", "name": "Gavin Hu", "email": "gavin.hu@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/1537172244-64874-3-git-send-email-gavin.hu@arm.com/mbox/", "series": [ { "id": 1347, "url": "http://patches.dpdk.org/api/series/1347/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1347", "date": "2018-09-17T08:17:22", "name": "[v3,1/3] ring: read tail using atomic load", "version": 3, "mbox": "http://patches.dpdk.org/series/1347/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/44781/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/44781/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 4577C5681;\n\tMon, 17 Sep 2018 10:17:47 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.101.70])\n\tby dpdk.org (Postfix) with ESMTP id C57775398;\n\tMon, 17 Sep 2018 10:17:44 +0200 (CEST)", "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 4298780D;\n\tMon, 17 Sep 2018 01:17:44 -0700 (PDT)", "from net-arm-thunderx2.shanghai.arm.com\n\t(net-arm-thunderx2.shanghai.arm.com [10.169.40.70])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id\n\tCD43D3F5C0; Mon, 17 Sep 2018 01:17:42 -0700 (PDT)" ], "From": "Gavin Hu <gavin.hu@arm.com>", "To": "dev@dpdk.org", "Cc": "gavin.hu@arm.com, Honnappa.Nagarahalli@arm.com, steve.capper@arm.com,\n\tOla.Liljedahl@arm.com, jerin.jacob@caviumnetworks.com, nd@arm.com,\n\tstable@dpdk.org", "Date": "Mon, 17 Sep 2018 16:17:24 +0800", "Message-Id": "<1537172244-64874-3-git-send-email-gavin.hu@arm.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1537172244-64874-1-git-send-email-gavin.hu@arm.com>", "References": "<20180807031943.5331-1-gavin.hu@arm.com>\n\t<1537172244-64874-1-git-send-email-gavin.hu@arm.com>", "Subject": "[dpdk-dev] [PATCH v3 3/3] ring: move the atomic load of head above\n\tthe loop", "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": "In __rte_ring_move_prod_head, move the __atomic_load_n up and out of\nthe do {} while loop as upon failure the old_head will be updated,\nanother load is costly and not necessary.\n\nThis helps a little on the latency,about 1~5%.\n\n Test result with the patch(two cores):\n SP/SC bulk enq/dequeue (size: 8): 5.64\n MP/MC bulk enq/dequeue (size: 8): 9.58\n SP/SC bulk enq/dequeue (size: 32): 1.98\n MP/MC bulk enq/dequeue (size: 32): 2.30\n\nFixes: 39368ebfc6 (\"ring: introduce C11 memory model barrier option\")\nCc: stable@dpdk.org\n\nSigned-off-by: Gavin Hu <gavin.hu@arm.com>\nReviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>\nReviewed-by: Steve Capper <steve.capper@arm.com>\nReviewed-by: Ola Liljedahl <Ola.Liljedahl@arm.com>\n---\n lib/librte_ring/rte_ring_c11_mem.h | 10 ++++------\n 1 file changed, 4 insertions(+), 6 deletions(-)", "diff": "diff --git a/lib/librte_ring/rte_ring_c11_mem.h b/lib/librte_ring/rte_ring_c11_mem.h\nindex 0eae3b3..95cc508 100644\n--- a/lib/librte_ring/rte_ring_c11_mem.h\n+++ b/lib/librte_ring/rte_ring_c11_mem.h\n@@ -61,13 +61,11 @@ __rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp,\n \tunsigned int max = n;\n \tint success;\n \n+\t*old_head = __atomic_load_n(&r->prod.head, __ATOMIC_ACQUIRE);\n \tdo {\n \t\t/* Reset n to the initial burst count */\n \t\tn = max;\n \n-\t\t*old_head = __atomic_load_n(&r->prod.head,\n-\t\t\t\t\t__ATOMIC_ACQUIRE);\n-\n \t\t/* load-acquire synchronize with store-release of ht->tail\n \t\t * in update_tail.\n \t\t */\n@@ -93,6 +91,7 @@ __rte_ring_move_prod_head(struct rte_ring *r, unsigned int is_sp,\n \t\tif (is_sp)\n \t\t\tr->prod.head = *new_head, success = 1;\n \t\telse\n+\t\t\t/* on failure, *old_head is updated */\n \t\t\tsuccess = __atomic_compare_exchange_n(&r->prod.head,\n \t\t\t\t\told_head, *new_head,\n \t\t\t\t\t0, __ATOMIC_ACQUIRE,\n@@ -134,13 +133,11 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc,\n \tint success;\n \n \t/* move cons.head atomically */\n+\t*old_head = __atomic_load_n(&r->cons.head, __ATOMIC_ACQUIRE);\n \tdo {\n \t\t/* Restore n as it may change every loop */\n \t\tn = max;\n \n-\t\t*old_head = __atomic_load_n(&r->cons.head,\n-\t\t\t\t\t__ATOMIC_ACQUIRE);\n-\n \t\t/* this load-acquire synchronize with store-release of ht->tail\n \t\t * in update_tail.\n \t\t */\n@@ -165,6 +162,7 @@ __rte_ring_move_cons_head(struct rte_ring *r, int is_sc,\n \t\tif (is_sc)\n \t\t\tr->cons.head = *new_head, success = 1;\n \t\telse\n+\t\t\t/* on failure, *old_head will be updated */\n \t\t\tsuccess = __atomic_compare_exchange_n(&r->cons.head,\n \t\t\t\t\t\t\told_head, *new_head,\n \t\t\t\t\t\t\t0, __ATOMIC_ACQUIRE,\n", "prefixes": [ "v3", "3/3" ] }{ "id": 44781, "url": "