From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 095BC5F3C for ; Wed, 27 Mar 2019 12:20:55 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2019 04:20:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,276,1549958400"; d="scan'208";a="126276537" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga007.jf.intel.com with ESMTP; 27 Mar 2019 04:20:53 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.210]) by IRSMSX154.ger.corp.intel.com ([169.254.12.238]) with mapi id 14.03.0415.000; Wed, 27 Mar 2019 11:20:52 +0000 From: "Ananyev, Konstantin" To: Joyce Kong , "dev@dpdk.org" CC: "nd@arm.com" , "stephen@networkplumber.org" , "jerin.jacob@caviumnetworks.com" , "thomas@monjalon.net" , "honnappa.nagarahalli@arm.com" , "gavin.hu@arm.com" Thread-Topic: [PATCH v8 0/3] ticketlock: implement ticketlock and add test case Thread-Index: AQHU4vuIPLLr5NLGm0KeneLUFSk6SKYfWCBQ Date: Wed, 27 Mar 2019 11:20:51 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580136560936@irsmsx105.ger.corp.intel.com> References: <1547802943-18711-1-git-send-email-joyce.kong@arm.com> <1553512269-146074-1-git-send-email-joyce.kong@arm.com> In-Reply-To: <1553512269-146074-1-git-send-email-joyce.kong@arm.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjAwNGQzMTctZWIwZS00NTk2LWFjOTAtMTRkMWZmZjAyYTE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY2RPVDBLd0hrZWtUYmg2ZXl6VTJ4eHBrMEd0WUhHdHVCQzFPTEYyR1d2QWliWVZDdDZLUFZjR3JkbmtibUIxZCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v8 0/3] ticketlock: implement ticketlock and add test case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Mar 2019 11:20:56 -0000 >=20 > v8: > 1. Enhance functional test for ticketlock by adding extra verificatio= n to ensure correct locking in MT env. > 2. Amortize the cost of getting time in test case. > (Suggested by Konstantin Ananyev) >=20 > v7: > 1. Modify trylock to compare both current and next fields to gurantee= the lock > being obtained only if tl->current=3D=3D1(lock is free). > As within the trylock function, suppose next=3D=3Dcurr=3D1, then this= thread will > experience really long context switch, and next time it continues its > execution and tl->next wraps around to 1 again and tl_couurent=3D=3D0= (lock > held by another thread),this trylock will return a success, that mean= s > two threads holding the lock. (Suggested by Konstantin Ananyev) > 2. Let all archs use generic ticketlock implementation. >=20 > v6: > Add rte_ticketlock.h in lib/librte_eal/common/include/arch/arm/. > Sort header inside ticketlock files by alphabetical order. >=20 > v5: > Change the variants inside rte_ticket_lock from unint to uint16_t for= binary > compatibility with the plain spin lock(suggested by Honnappa Nagaraha= lli)). >=20 > v4: > Change some assignment operation in recursive ticket lock to __atomic= . >=20 > V3: > 1.Update ticketlock intrduction(suggested by Honnappa Nagarahalli). > 2.Change the implementation of rte_ticketlock_trylock to CAS(suggeste= d by Honnappa Nagarahalli). >=20 > V2: > 1.Update commit message(suggested by Jerin Jacob). > 2.Add ticketlock test cases(suggested by Jerin Jacob). >=20 > V1: > Implement ticket lock to improve lock fairness and prdictability. >=20 > As shown on thundex-2 platform: > *** ticketlock_autotest with this patch *** > Core [0] count =3D 496 > Core [1] count =3D 495 > Core [2] count =3D 498 > ... > Core [209] count =3D 488 > Core [210] count =3D 490 > Core [211] count =3D 474 >=20 > Joyce Kong (3): > eal/ticketlock: ticket based to improve fairness > eal/ticketlock: enable generic ticketlock on all arch > test/ticketlock: add ticket lock test case >=20 > MAINTAINERS | 5 + > app/test/Makefile | 1 + > app/test/autotest_data.py | 6 + > app/test/meson.build | 1 + > app/test/test_ticketlock.c | 319 +++++++++++++++= ++++++ > doc/api/doxy-api-index.md | 1 + > lib/librte_eal/common/Makefile | 2 +- > .../common/include/arch/arm/rte_ticketlock.h | 22 ++ > .../common/include/arch/ppc_64/rte_ticketlock.h | 18 ++ > .../common/include/arch/x86/rte_ticketlock.h | 18 ++ > .../common/include/generic/rte_ticketlock.h | 215 ++++++++++++++ > lib/librte_eal/common/meson.build | 1 + > 12 files changed, 608 insertions(+), 1 deletion(-) > create mode 100644 app/test/test_ticketlock.c > create mode 100644 lib/librte_eal/common/include/arch/arm/rte_ticketlock= .h > create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_ticketl= ock.h > create mode 100644 lib/librte_eal/common/include/arch/x86/rte_ticketlock= .h > create mode 100644 lib/librte_eal/common/include/generic/rte_ticketlock.= h >=20 > -- Acked-by: Konstantin Ananyev > 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E06BDA05D3 for ; Wed, 27 Mar 2019 12:20:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B61858E76; Wed, 27 Mar 2019 12:20:57 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 095BC5F3C for ; Wed, 27 Mar 2019 12:20:55 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Mar 2019 04:20:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,276,1549958400"; d="scan'208";a="126276537" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by orsmga007.jf.intel.com with ESMTP; 27 Mar 2019 04:20:53 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.210]) by IRSMSX154.ger.corp.intel.com ([169.254.12.238]) with mapi id 14.03.0415.000; Wed, 27 Mar 2019 11:20:52 +0000 From: "Ananyev, Konstantin" To: Joyce Kong , "dev@dpdk.org" CC: "nd@arm.com" , "stephen@networkplumber.org" , "jerin.jacob@caviumnetworks.com" , "thomas@monjalon.net" , "honnappa.nagarahalli@arm.com" , "gavin.hu@arm.com" Thread-Topic: [PATCH v8 0/3] ticketlock: implement ticketlock and add test case Thread-Index: AQHU4vuIPLLr5NLGm0KeneLUFSk6SKYfWCBQ Date: Wed, 27 Mar 2019 11:20:51 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772580136560936@irsmsx105.ger.corp.intel.com> References: <1547802943-18711-1-git-send-email-joyce.kong@arm.com> <1553512269-146074-1-git-send-email-joyce.kong@arm.com> In-Reply-To: <1553512269-146074-1-git-send-email-joyce.kong@arm.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjAwNGQzMTctZWIwZS00NTk2LWFjOTAtMTRkMWZmZjAyYTE0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY2RPVDBLd0hrZWtUYmg2ZXl6VTJ4eHBrMEd0WUhHdHVCQzFPTEYyR1d2QWliWVZDdDZLUFZjR3JkbmtibUIxZCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v8 0/3] ticketlock: implement ticketlock and add test case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190327112051.YikbFJFcbFrsn_80iUzpoKhQsLWhsJbt4NyZsHFijcg@z> >=20 > v8: > 1. Enhance functional test for ticketlock by adding extra verificatio= n to ensure correct locking in MT env. > 2. Amortize the cost of getting time in test case. > (Suggested by Konstantin Ananyev) >=20 > v7: > 1. Modify trylock to compare both current and next fields to gurantee= the lock > being obtained only if tl->current=3D=3D1(lock is free). > As within the trylock function, suppose next=3D=3Dcurr=3D1, then this= thread will > experience really long context switch, and next time it continues its > execution and tl->next wraps around to 1 again and tl_couurent=3D=3D0= (lock > held by another thread),this trylock will return a success, that mean= s > two threads holding the lock. (Suggested by Konstantin Ananyev) > 2. Let all archs use generic ticketlock implementation. >=20 > v6: > Add rte_ticketlock.h in lib/librte_eal/common/include/arch/arm/. > Sort header inside ticketlock files by alphabetical order. >=20 > v5: > Change the variants inside rte_ticket_lock from unint to uint16_t for= binary > compatibility with the plain spin lock(suggested by Honnappa Nagaraha= lli)). >=20 > v4: > Change some assignment operation in recursive ticket lock to __atomic= . >=20 > V3: > 1.Update ticketlock intrduction(suggested by Honnappa Nagarahalli). > 2.Change the implementation of rte_ticketlock_trylock to CAS(suggeste= d by Honnappa Nagarahalli). >=20 > V2: > 1.Update commit message(suggested by Jerin Jacob). > 2.Add ticketlock test cases(suggested by Jerin Jacob). >=20 > V1: > Implement ticket lock to improve lock fairness and prdictability. >=20 > As shown on thundex-2 platform: > *** ticketlock_autotest with this patch *** > Core [0] count =3D 496 > Core [1] count =3D 495 > Core [2] count =3D 498 > ... > Core [209] count =3D 488 > Core [210] count =3D 490 > Core [211] count =3D 474 >=20 > Joyce Kong (3): > eal/ticketlock: ticket based to improve fairness > eal/ticketlock: enable generic ticketlock on all arch > test/ticketlock: add ticket lock test case >=20 > MAINTAINERS | 5 + > app/test/Makefile | 1 + > app/test/autotest_data.py | 6 + > app/test/meson.build | 1 + > app/test/test_ticketlock.c | 319 +++++++++++++++= ++++++ > doc/api/doxy-api-index.md | 1 + > lib/librte_eal/common/Makefile | 2 +- > .../common/include/arch/arm/rte_ticketlock.h | 22 ++ > .../common/include/arch/ppc_64/rte_ticketlock.h | 18 ++ > .../common/include/arch/x86/rte_ticketlock.h | 18 ++ > .../common/include/generic/rte_ticketlock.h | 215 ++++++++++++++ > lib/librte_eal/common/meson.build | 1 + > 12 files changed, 608 insertions(+), 1 deletion(-) > create mode 100644 app/test/test_ticketlock.c > create mode 100644 lib/librte_eal/common/include/arch/arm/rte_ticketlock= .h > create mode 100644 lib/librte_eal/common/include/arch/ppc_64/rte_ticketl= ock.h > create mode 100644 lib/librte_eal/common/include/arch/x86/rte_ticketlock= .h > create mode 100644 lib/librte_eal/common/include/generic/rte_ticketlock.= h >=20 > -- Acked-by: Konstantin Ananyev > 2.7.4