From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80050.outbound.protection.outlook.com [40.107.8.50]) by dpdk.org (Postfix) with ESMTP id C6CF2A3 for ; Mon, 1 Apr 2019 22:06:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sJJ/wKwYNrXKDpIauEk7w0y6JxO4yuuy8jPH+k2bs2U=; b=Tm8nwUxUGpbBILUS6aPnS/FnrmZDKiN5DP2o4oJz8Y3B1Y2a00r5RGnGSXAwI6GxsU5XW8HkQGvVCEjq5xqE9eoLB7dT1m3+bJYwseKs7KimJWvrC6my1jMH7Ym/R3SG9fmMhOEOD4kmceqBfD3GyGEspvZ+5g0fggD+C+ITwXs= Received: from AM0PR08MB3379.eurprd08.prod.outlook.com (20.177.109.142) by AM0PR08MB3555.eurprd08.prod.outlook.com (20.177.108.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.20; Mon, 1 Apr 2019 20:06:37 +0000 Received: from AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::287d:1c71:2689:7bfe]) by AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::287d:1c71:2689:7bfe%5]) with mapi id 15.20.1750.017; Mon, 1 Apr 2019 20:06:37 +0000 From: Dharmik Thakkar To: "Wang, Yipeng1" CC: "Gobriel, Sameh" , "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt Thread-Index: AQHU4070DAHPZc4sWkiWSq24p76DDqYnsmqAgAATyoA= Date: Mon, 1 Apr 2019 20:06:37 +0000 Message-ID: References: <20190320223513.31249-1-dharmik.thakkar@arm.com> <20190325210838.2853-1-dharmik.thakkar@arm.com> <20190325210838.2853-3-dharmik.thakkar@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Dharmik.Thakkar@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9373b467-9e31-4e7f-7967-08d6b6dd8c39 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM0PR08MB3555; x-ms-traffictypediagnostic: AM0PR08MB3555: nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(366004)(346002)(376002)(13464003)(189003)(199004)(256004)(25786009)(105586002)(71190400001)(106356001)(6916009)(6486002)(478600001)(6436002)(5660300002)(36756003)(83716004)(229853002)(71200400001)(11346002)(2616005)(476003)(68736007)(486006)(33656002)(14454004)(446003)(8676002)(86362001)(26005)(305945005)(76176011)(72206003)(7736002)(97736004)(316002)(81166006)(99286004)(6512007)(81156014)(82746002)(66066001)(93886005)(8936002)(2906002)(53936002)(102836004)(54906003)(186003)(6506007)(53546011)(6246003)(3846002)(6116002)(4326008)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3555; H:AM0PR08MB3379.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: bbtpBsQle9tv22FMSO8iypflyhq42EZya573BNHAt6674L21+KcUa42ODjoGrUCHQvzkNZGcTnhw9sWb39k5wkwkJttK/ZAeiHAt5oMX0SmuXUt8BYzNcMPVrUv4DYR9BZLgmUG0Y7tBPhuzOx83AIo3/Elk0FKVUh1JtYmGF98DZV8DaPIJcwqQvsGyq1w8g/rD6oiREuGjbgUZ4bzl3dWq5FOi7kmKIV2RZ7+NtMeLGXZbPcz5L5IotmlmsLyYzNzjepYYKP+JfoeuW2ImjwtWPGp+HFJ8Xf902DFvVaB1VmRACqpdrqheP8IEHKXyWB3mURq4ZMiLOCU3Yts+KrTZSDuR3KkvjEFiAwM+XB2TxKgXi3VUbGdPPrProy2OkYhOGjUXW9Flsi76b5igtbqmsur8OU64+LCqt29YrPo= Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9373b467-9e31-4e7f-7967-08d6b6dd8c39 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 20:06:37.5357 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3555 Subject: Re: [dpdk-dev] [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt 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: Mon, 01 Apr 2019 20:06:39 -0000 +Honnappa Hi Yipeng, Thank you for the review comments! > On Apr 1, 2019, at 1:55 PM, Wang, Yipeng1 wrote: >=20 > A little bit improvement on commit-message maybe needed. >=20 >> -----Original Message----- >> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com] >> Sent: Monday, March 25, 2019 2:09 PM >> To: Wang, Yipeng1 ; Gobriel, Sameh ; Richardson, Bruce >> ; De Lara Guarch, Pablo >> Cc: dev@dpdk.org; Dharmik Thakkar >> Subject: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt > [Wang, Yipeng] *for* ext bucket Exceeds 50 characters limit. >>=20 >> Add unit test to check for hash lookup and bulk-lookup perf. > [Wang, Yipeng] for extendable bucket feature. Will update in the next version. >> Test with lock-free enabled and with lock-free disabled. > [Wang, Yipeng] It is tested with both lock-free enabled and disabled case= . Will update in the next version. >=20 >>=20 >> Test include: >>=20 >> - hash lookup on keys in ext bkt, >> hash delete causing key-shifts of keys from ext bkt to secondary bkt > [Wang, Yipeng]=20 > Two test scenarios right? A bit of formatting.. > Tests include: It is a single test wherein lookup perf is tested for with hash delete caus= ing key-shifts. I will put it as Test includes: > - hash lookup on keys in ext bucket. > - hash delete causing key-shifts of keys from ext bucket to secondary buc= ket. > =20 >>=20 >> Suggested-by: Honnappa Nagarahalli >> Signed-off-by: Dharmik Thakkar >> --- >> +/* >> + * Test lookup perf: >> + * Reader(s) lookup keys present in the extendable bkt. >> + */ >> +static int >> +test_hash_add_ks_lookup_hit_extbkt(struct rwc_perf *rwc_perf_results, >> + int rwc_lf, int htm, int ext_bkt) >> +{ >> + unsigned int n, m; >> + uint64_t i; >> + int use_jhash =3D 0; >> + uint8_t write_type; >> + uint8_t read_type =3D READ_PASS_KEY_SHIFTS_EXTBKT; >> + >> + rte_atomic64_init(&greads); >> + rte_atomic64_init(&gread_cycles); >> + >> + if (init_params(rwc_lf, use_jhash, htm, ext_bkt) !=3D 0) >> + goto err; >> + printf("\nTest: Hash add - key-shifts, read - hit (ext_bkt)\n"); >> + for (m =3D 0; m < 2; m++) { >> + if (m =3D=3D 1) { >> + printf("\n** With bulk-lookup **\n"); >> + read_type |=3D BULK_LOOKUP; >> + } >> + for (n =3D 0; n < NUM_TEST; n++) { >> + unsigned int tot_lcore =3D rte_lcore_count(); >> + if (tot_lcore < rwc_core_cnt[n] + 1) >> + goto finish; >> + >> + printf("\nNumber of readers: %u\n", rwc_core_cnt[n]); >> + >> + rte_atomic64_clear(&greads); >> + rte_atomic64_clear(&gread_cycles); >> + >> + rte_hash_reset(tbl_rwc_test_param.h); >> + write_type =3D WRITE_NO_KEY_SHIFT; >> + if (write_keys(write_type) < 0) >> + goto err; >> + write_type =3D WRITE_KEY_SHIFT; >> + if (write_keys(write_type) < 0) >> + goto err; >> + writer_done =3D 0; >> + for (i =3D 1; i <=3D rwc_core_cnt[n]; i++) >> + rte_eal_remote_launch(test_rwc_reader, >> + (void *)(uintptr_t)read_type, >> + enabled_core_ids[i]); >> + for (i =3D 0; i < tbl_rwc_test_param.count_keys_ks_extbkt; >> + i++) { >> + if (rte_hash_del_key(tbl_rwc_test_param.h, >> + tbl_rwc_test_param.keys_ks_extbkt + i) >> + < 0) { >> + printf("Delete Failed: %u\n", >> + tbl_rwc_test_param.keys_ks_extbkt[i]); >> + goto err; >> + } >> + } >> + writer_done =3D 1; >> + rte_eal_mp_wait_lcore(); > [Wang, Yipeng] Not requirement for this perf patch, but is it better to r= ead the shifted key again > Just to verify the logic? If not difficult please add. Keys in ext bkt (including shifted keys) are being read in a loop while wri= ter_done equals 0 i.e. while keys are being deleted. Test fails if look up fails. Do you think there is still a need to add one = more round of look up on all the keys in ext bkt (some of which have now be= en shifted to secondary bkts)? 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 8BBCDA0679 for ; Mon, 1 Apr 2019 22:06:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 80CE12E81; Mon, 1 Apr 2019 22:06:39 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80050.outbound.protection.outlook.com [40.107.8.50]) by dpdk.org (Postfix) with ESMTP id C6CF2A3 for ; Mon, 1 Apr 2019 22:06:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sJJ/wKwYNrXKDpIauEk7w0y6JxO4yuuy8jPH+k2bs2U=; b=Tm8nwUxUGpbBILUS6aPnS/FnrmZDKiN5DP2o4oJz8Y3B1Y2a00r5RGnGSXAwI6GxsU5XW8HkQGvVCEjq5xqE9eoLB7dT1m3+bJYwseKs7KimJWvrC6my1jMH7Ym/R3SG9fmMhOEOD4kmceqBfD3GyGEspvZ+5g0fggD+C+ITwXs= Received: from AM0PR08MB3379.eurprd08.prod.outlook.com (20.177.109.142) by AM0PR08MB3555.eurprd08.prod.outlook.com (20.177.108.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.20; Mon, 1 Apr 2019 20:06:37 +0000 Received: from AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::287d:1c71:2689:7bfe]) by AM0PR08MB3379.eurprd08.prod.outlook.com ([fe80::287d:1c71:2689:7bfe%5]) with mapi id 15.20.1750.017; Mon, 1 Apr 2019 20:06:37 +0000 From: Dharmik Thakkar To: "Wang, Yipeng1" CC: "Gobriel, Sameh" , "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt Thread-Index: AQHU4070DAHPZc4sWkiWSq24p76DDqYnsmqAgAATyoA= Date: Mon, 1 Apr 2019 20:06:37 +0000 Message-ID: References: <20190320223513.31249-1-dharmik.thakkar@arm.com> <20190325210838.2853-1-dharmik.thakkar@arm.com> <20190325210838.2853-3-dharmik.thakkar@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Dharmik.Thakkar@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9373b467-9e31-4e7f-7967-08d6b6dd8c39 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM0PR08MB3555; x-ms-traffictypediagnostic: AM0PR08MB3555: nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(366004)(346002)(376002)(13464003)(189003)(199004)(256004)(25786009)(105586002)(71190400001)(106356001)(6916009)(6486002)(478600001)(6436002)(5660300002)(36756003)(83716004)(229853002)(71200400001)(11346002)(2616005)(476003)(68736007)(486006)(33656002)(14454004)(446003)(8676002)(86362001)(26005)(305945005)(76176011)(72206003)(7736002)(97736004)(316002)(81166006)(99286004)(6512007)(81156014)(82746002)(66066001)(93886005)(8936002)(2906002)(53936002)(102836004)(54906003)(186003)(6506007)(53546011)(6246003)(3846002)(6116002)(4326008)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3555; H:AM0PR08MB3379.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: bbtpBsQle9tv22FMSO8iypflyhq42EZya573BNHAt6674L21+KcUa42ODjoGrUCHQvzkNZGcTnhw9sWb39k5wkwkJttK/ZAeiHAt5oMX0SmuXUt8BYzNcMPVrUv4DYR9BZLgmUG0Y7tBPhuzOx83AIo3/Elk0FKVUh1JtYmGF98DZV8DaPIJcwqQvsGyq1w8g/rD6oiREuGjbgUZ4bzl3dWq5FOi7kmKIV2RZ7+NtMeLGXZbPcz5L5IotmlmsLyYzNzjepYYKP+JfoeuW2ImjwtWPGp+HFJ8Xf902DFvVaB1VmRACqpdrqheP8IEHKXyWB3mURq4ZMiLOCU3Yts+KrTZSDuR3KkvjEFiAwM+XB2TxKgXi3VUbGdPPrProy2OkYhOGjUXW9Flsi76b5igtbqmsur8OU64+LCqt29YrPo= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9373b467-9e31-4e7f-7967-08d6b6dd8c39 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 20:06:37.5357 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3555 Subject: Re: [dpdk-dev] [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt 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: <20190401200637.jeSvJBHCYpJBStbME3ooRMH-OUqMLE_47p8ybzzHEuw@z> +Honnappa Hi Yipeng, Thank you for the review comments! > On Apr 1, 2019, at 1:55 PM, Wang, Yipeng1 wrote: >=20 > A little bit improvement on commit-message maybe needed. >=20 >> -----Original Message----- >> From: Dharmik Thakkar [mailto:dharmik.thakkar@arm.com] >> Sent: Monday, March 25, 2019 2:09 PM >> To: Wang, Yipeng1 ; Gobriel, Sameh ; Richardson, Bruce >> ; De Lara Guarch, Pablo >> Cc: dev@dpdk.org; Dharmik Thakkar >> Subject: [PATCH v2 2/2] test/hash: lock-free rw concurrency test ext bkt > [Wang, Yipeng] *for* ext bucket Exceeds 50 characters limit. >>=20 >> Add unit test to check for hash lookup and bulk-lookup perf. > [Wang, Yipeng] for extendable bucket feature. Will update in the next version. >> Test with lock-free enabled and with lock-free disabled. > [Wang, Yipeng] It is tested with both lock-free enabled and disabled case= . Will update in the next version. >=20 >>=20 >> Test include: >>=20 >> - hash lookup on keys in ext bkt, >> hash delete causing key-shifts of keys from ext bkt to secondary bkt > [Wang, Yipeng]=20 > Two test scenarios right? A bit of formatting.. > Tests include: It is a single test wherein lookup perf is tested for with hash delete caus= ing key-shifts. I will put it as Test includes: > - hash lookup on keys in ext bucket. > - hash delete causing key-shifts of keys from ext bucket to secondary buc= ket. > =20 >>=20 >> Suggested-by: Honnappa Nagarahalli >> Signed-off-by: Dharmik Thakkar >> --- >> +/* >> + * Test lookup perf: >> + * Reader(s) lookup keys present in the extendable bkt. >> + */ >> +static int >> +test_hash_add_ks_lookup_hit_extbkt(struct rwc_perf *rwc_perf_results, >> + int rwc_lf, int htm, int ext_bkt) >> +{ >> + unsigned int n, m; >> + uint64_t i; >> + int use_jhash =3D 0; >> + uint8_t write_type; >> + uint8_t read_type =3D READ_PASS_KEY_SHIFTS_EXTBKT; >> + >> + rte_atomic64_init(&greads); >> + rte_atomic64_init(&gread_cycles); >> + >> + if (init_params(rwc_lf, use_jhash, htm, ext_bkt) !=3D 0) >> + goto err; >> + printf("\nTest: Hash add - key-shifts, read - hit (ext_bkt)\n"); >> + for (m =3D 0; m < 2; m++) { >> + if (m =3D=3D 1) { >> + printf("\n** With bulk-lookup **\n"); >> + read_type |=3D BULK_LOOKUP; >> + } >> + for (n =3D 0; n < NUM_TEST; n++) { >> + unsigned int tot_lcore =3D rte_lcore_count(); >> + if (tot_lcore < rwc_core_cnt[n] + 1) >> + goto finish; >> + >> + printf("\nNumber of readers: %u\n", rwc_core_cnt[n]); >> + >> + rte_atomic64_clear(&greads); >> + rte_atomic64_clear(&gread_cycles); >> + >> + rte_hash_reset(tbl_rwc_test_param.h); >> + write_type =3D WRITE_NO_KEY_SHIFT; >> + if (write_keys(write_type) < 0) >> + goto err; >> + write_type =3D WRITE_KEY_SHIFT; >> + if (write_keys(write_type) < 0) >> + goto err; >> + writer_done =3D 0; >> + for (i =3D 1; i <=3D rwc_core_cnt[n]; i++) >> + rte_eal_remote_launch(test_rwc_reader, >> + (void *)(uintptr_t)read_type, >> + enabled_core_ids[i]); >> + for (i =3D 0; i < tbl_rwc_test_param.count_keys_ks_extbkt; >> + i++) { >> + if (rte_hash_del_key(tbl_rwc_test_param.h, >> + tbl_rwc_test_param.keys_ks_extbkt + i) >> + < 0) { >> + printf("Delete Failed: %u\n", >> + tbl_rwc_test_param.keys_ks_extbkt[i]); >> + goto err; >> + } >> + } >> + writer_done =3D 1; >> + rte_eal_mp_wait_lcore(); > [Wang, Yipeng] Not requirement for this perf patch, but is it better to r= ead the shifted key again > Just to verify the logic? If not difficult please add. Keys in ext bkt (including shifted keys) are being read in a loop while wri= ter_done equals 0 i.e. while keys are being deleted. Test fails if look up fails. Do you think there is still a need to add one = more round of look up on all the keys in ext bkt (some of which have now be= en shifted to secondary bkts)?