From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0AB0DA0487 for ; Tue, 2 Jul 2019 19:23:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 006771B99F; Tue, 2 Jul 2019 19:23:06 +0200 (CEST) Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10057.outbound.protection.outlook.com [40.107.1.57]) by dpdk.org (Postfix) with ESMTP id D1B4D1B946; Tue, 2 Jul 2019 19:23:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LsYiZ243LDXjG6YyoQfsN66zLsShZH5I0zjgXOmZW9g=; b=o7vOKgQvtpHLAU3vvwXg1XaFG3s6k6Et3o5e/m1w63qfQM24lwV5ySdk72EL9tjWFSBizAoFZbxpz9xFu0sF/OvrLN7Cuu6feP0TACAQDeg4WI2rZYEWOVu6h0Th79+e0ra+6FoQhrYmtfmGp8U21Wo2468ob7J7LqHhO2tr6hc= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.152) by VE1PR08MB4830.eurprd08.prod.outlook.com (10.255.113.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Tue, 2 Jul 2019 17:23:02 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::a89e:33:fbda:ed35]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::a89e:33:fbda:ed35%4]) with mapi id 15.20.2032.019; Tue, 2 Jul 2019 17:23:02 +0000 From: Honnappa Nagarahalli To: "Wang, Yipeng1" , "Gobriel, Sameh" , "Richardson, Bruce" , "De Lara Guarch, Pablo" CC: "Gavin Hu (Arm Technology China)" , "Ruifeng Wang (Arm Technology China)" , "dev@dpdk.org" , Honnappa Nagarahalli , nd , "stable@dpdk.org" , nd Thread-Topic: [PATCH 3/3] lib/hash: adjust tbl_chng_cnt position Thread-Index: AQHVLeJXrDrFMf75zUqimbqMLjmV8aa2w1Og Date: Tue, 2 Jul 2019 17:23:01 +0000 Message-ID: References: <20190625211520.43181-1-honnappa.nagarahalli@arm.com> <20190625211520.43181-4-honnappa.nagarahalli@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: de01aec7-22da-4ef8-b28b-2740f5a9cfd0.0 x-checkrecipientchecked: true authentication-results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 86d13a94-95ed-4574-bd07-08d6ff11efba x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:VE1PR08MB4830; x-ms-traffictypediagnostic: VE1PR08MB4830: x-microsoft-antispam-prvs: nodisclaimer: True x-ms-oob-tlc-oobclassifiers: OLM:1728; x-forefront-prvs: 008663486A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(199004)(189003)(102836004)(71190400001)(8936002)(68736007)(7696005)(99286004)(81156014)(8676002)(66946007)(71200400001)(26005)(64756008)(74316002)(76176011)(52536014)(66446008)(486006)(72206003)(7736002)(5660300002)(14444005)(66476007)(66556008)(76116006)(25786009)(81166006)(73956011)(14454004)(6506007)(476003)(33656002)(9686003)(4326008)(446003)(86362001)(305945005)(256004)(316002)(11346002)(6436002)(110136005)(53936002)(186003)(54906003)(6246003)(66066001)(229853002)(55016002)(6116002)(3846002)(2906002)(478600001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4830; H:VE1PR08MB5149.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: 8cVaG6HVgBISuAPIMTPpgCyvJBgqxcawBJDM6IgRBqDMiXI9xGv4MOSlZub1LsNdGPLlEbzTdRvdEkMxNpKnkwdj76KO+flcZO+UMVqc0S+JMXo7Afr251a5hj2Iq+5LMOFu/+fOtYq8f/8ukwOqoNARTyR+UepDh+/HymxIIhjWgtq2YMNPEoflZV95mqN4vHQV40gNloSA75lubILh424Z5tkknNn0iJEIXMb53radICbBnCHWRbwZtJ4jNI3vu/atDVrfgf4fyFRW0mCloHXpATdDgtkJ6ZPHf3Yr6IRfNqp+Js9Q3k3S9vxGJZfoiGEiWYolAo+nwI4B/sN1A7/25bUU9iOW9ahXVS1XxekeZKNYrwY5LAq+jJOB1Xfc3+bxh5c5MIdLzgis05y111bZ6u9Px2DJXinyhna90NE= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86d13a94-95ed-4574-bd07-08d6ff11efba X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2019 17:23:01.9924 (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-CrossTenant-userprincipalname: Honnappa.Nagarahalli@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4830 Subject: Re: [dpdk-dev] [PATCH 3/3] lib/hash: adjust tbl_chng_cnt position 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" > > > >tbl_chng_cnt is one of the first elements of the structure used in the > >lookup. Move it to the beginning of the cache line to gain performance. > > > >Fixes: e605a1d36 ("hash: add lock-free r/w concurrency") > >Cc: stable@dpdk.org > > > >Signed-off-by: Honnappa Nagarahalli > >Reviewed-by: Gavin Hu > >Tested-by: Ruifeng Wang > >--- > > lib/librte_hash/rte_cuckoo_hash.h | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > >diff --git a/lib/librte_hash/rte_cuckoo_hash.h > >b/lib/librte_hash/rte_cuckoo_hash.h > >index fb19bb27d..af6451b5c 100644 > >--- a/lib/librte_hash/rte_cuckoo_hash.h > >+++ b/lib/librte_hash/rte_cuckoo_hash.h > >@@ -170,7 +170,9 @@ struct rte_hash { > > > > /* Fields used in lookup */ > > > >- uint32_t key_len __rte_cache_aligned; > >+ uint32_t *tbl_chng_cnt __rte_cache_aligned; > >+ /**< Indicates if the hash table changed from last read. */ > >+ uint32_t key_len; > > /**< Length of hash key. */ > > uint8_t hw_trans_mem_support; > > /**< If hardware transactional memory is used. */ @@ -218,8 +220,6 > @@ > >struct rte_hash { > > * is piggy-backed to freeing of the key index. > > */ > > uint32_t *ext_bkt_to_free; > >- uint32_t *tbl_chng_cnt; > >- /**< Indicates if the hash table changed from last read. */ > > } __rte_cache_aligned; > > > > struct queue_node { > >-- > >2.17.1 >=20 > [Wang, Yipeng] > I am not sure about this change. By moving counter to front, I think you > seems push key_store out of the cache line. And key_store Is also used in > lookup (and more commonly). > My tests also show perf drop in many cases. I ran hash_readwrite_lf tests and L3 fwd application. Both of them showed i= mprovements for both lock-free and using locks for Arm platforms (L3 fwd wa= s not run on x86). Which tests are resulting in performance drops for you? But, I do agree that this work is not complete. We can drop this patch and = take this up separately.