From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00089.outbound.protection.outlook.com [40.107.0.89]) by dpdk.org (Postfix) with ESMTP id 47E32325F; Mon, 12 Nov 2018 19:34:09 +0100 (CET) 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=tbGvXIWQpX/ez6gmZd+c3tUi/mMY4D7pw6L7xRizIrY=; b=Dr/FUk7r4sIzt7VWkBe4sVToFPdzC5nLbtr8xwmqgPYIZE6e1YXUAWoeQs13KUIWajX0x/ZPbghvTymt1/JnxZnEVbSUQS8COIAKX+v+3pzcgT0Ar0JUlhN0or+Zv9bzsNPiyvwiY6oQK1hpdLDP9/804u4dt/KjO4RYBRDgM7I= Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.29) by AM6PR08MB3656.eurprd08.prod.outlook.com (20.177.115.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Mon, 12 Nov 2018 18:34:08 +0000 Received: from AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::c1a0:51bf:cd33:2b27]) by AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::c1a0:51bf:cd33:2b27%6]) with mapi id 15.20.1294.044; Mon, 12 Nov 2018 18:34:08 +0000 From: Honnappa Nagarahalli To: Bruce Richardson , "dev@dpdk.org" CC: "stable@dpdk.org" , Yipeng Wang , nd Thread-Topic: [dpdk-dev] [PATCH v2 2/4] hash: add local cache for TSX region Thread-Index: AQHUenUnhTpWWqfANECzeFHeMz/st6VMZdSg Date: Mon, 12 Nov 2018 18:34:08 +0000 Message-ID: References: <20181105173913.61225-1-bruce.richardson@intel.com> <20181112104719.62568-1-bruce.richardson@intel.com> <20181112104719.62568-3-bruce.richardson@intel.com> In-Reply-To: <20181112104719.62568-3-bruce.richardson@intel.com> 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=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR08MB3656; 6:42hE0fgSb/CSpUQnOOhkTZfdz+9DZGo99L+qvPCquciGcQ9SfcIoZRd65l0IxvQGUdeaulzE7XtoZTC0KpF/u+qsYCJ8+pFgr5OTUab9EJna3JqHtf9FTs4f7Kc6tFDtbQN5s5l4Rnrrm1LgvcWfrdFfbG9jcbdzCjoQwSdNq48V/hMZmCeakb2DPhAgdEDgPcjRXFLcJvCSvFSu5NACY7LfHJRhcirBDFnrnnc446x6P+0BQ3Zd3o7srYf5aLofNu59kTHvtHsmHB7qHH1GoAA5pxvkjbVTTomyfPRfkCUH57AJEcyyMpPOT0VyU786oy1kzBJmmPqIApelH21R2qQStRfxq+TUaS3E5Cc5wRuCbZMHS/TiPVhFu86CGrab243IFZOzffdfY6GDKBqOLtaUM3kr94joIo4CL1G11aemPOsRduQzC0eLmCjZ9cOqdvKHS74hh+gTl+q5NdbR7A==; 5:OUaMZqvXETw0lXnWHEi4h6Ixb7nN77STdMnTuosDqJBXlcHsaVrvXXdX9qE33DfgFUAsmvNlCtYyqMfwaFPsb2IIoYHZcgf+v7IrhsUOzC176VmAS72+s4rJT9i4jGdcwE9h2WMj9vvD1/wPz2A5u0RpVUq2kG1C8tPEL/PDaTk=; 7:udWy8UIqTuzzjRR69kStlwnRD1tLuqqF8S1phHc9He4NTtw18I+f39HsG4OAfKnCOIPslLxlRuU+f4M3Cafeu6dYRubzyLrKkKiRfFw0OLZTL5OQ4sojwbR32v1ojDbMBzeJrqKWZvmRJHcApP+4nQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 75ba81d2-3490-4d8d-659b-08d648cd6e9e x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR08MB3656; x-ms-traffictypediagnostic: AM6PR08MB3656: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231402)(944501410)(52105112)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM6PR08MB3656; BCL:0; PCL:0; RULEID:; SRVR:AM6PR08MB3656; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(396003)(376002)(136003)(346002)(366004)(199004)(189003)(2900100001)(11346002)(3846002)(486006)(186003)(25786009)(81166006)(6116002)(6246003)(68736007)(26005)(6506007)(102836004)(2501003)(8936002)(76176011)(55016002)(446003)(7696005)(8676002)(81156014)(476003)(72206003)(99286004)(229853002)(478600001)(97736004)(71200400001)(86362001)(71190400001)(66066001)(33656002)(105586002)(53936002)(106356001)(14444005)(305945005)(14454004)(256004)(5660300001)(6436002)(7736002)(74316002)(2906002)(4326008)(9686003)(110136005)(316002)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3656; H:AM6PR08MB3672.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-microsoft-antispam-message-info: HufCpZigeZfP7xNvZgZ4L2CqSKN5r7uNZNxtLKSjNxDEuMLb6QxGmAI/UKFroACNACgYo+h1cXi4P+CqB1ohppn5bEorAocgnsKK+6xWZSiPeuKfwv+H/GH0qBKS64+wtOK4AvVOr4pVZQzlpiERP/vdZ82P7dAeaq7j9LBZJLjbsh2G8eSSWijHawvIgzpqofO7ZPvnf09ThdAb5Jog97k4tInJMBhl2THN6j8Ns/OcO9L3e9xMetyDIy55vVZuGvYsUZcDAMw2MvZxpAydaMyoPtpoJ7I69+uuLhW1012LvLoab5IDuc4HaVjaX8HO/zECf/WZ10qkTEvMIjEpSpOhWqPrNzvw7XdXJGXqYb0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: 75ba81d2-3490-4d8d-659b-08d648cd6e9e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 18:34:08.0583 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3656 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2 2/4] hash: add local cache for TSX region X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 18:34:09 -0000 >=20 > From: Yipeng Wang >=20 > This patch adds back the local cache when TSX support is turned on. >=20 > When TSX is turned on, free key-data slot ring would be contended by vari= ous > TSX regions. The purpose of this commit is to reduce possible memory > collisions during key insertion. >=20 > Signed-off-by: Yipeng Wang > Acked-by: Bruce Richardson > --- > lib/librte_hash/rte_cuckoo_hash.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_hash/rte_cuckoo_hash.c > b/lib/librte_hash/rte_cuckoo_hash.c > index 76f5dc8..5d5f9f1 100644 > --- a/lib/librte_hash/rte_cuckoo_hash.c > +++ b/lib/librte_hash/rte_cuckoo_hash.c > @@ -180,8 +180,10 @@ struct rte_hash * > } >=20 > /* Check extra flags field to check extra options. */ > - if (params->extra_flag & > RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT) > + if (params->extra_flag & > RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT) { > + use_local_cache =3D 1; Do you see the issue even in the case of single writer? Enabling this flag = creates local caches on all the data plane cores. This increases the memory= usage for the single writer use case. Then there is 'writers on the contro= l plane' use case, the requirement on hash_add rate is comparatively lower = when compared to 'writers on the data plane'. The writers also are not pinn= ed to any core as well. In this use case, I am not sure how much having a l= ocal cache matters. Enabling this flag effectively changes the free slot allocation from a ring= to a stack data structure. Does it indicate that for single writer use cas= e with TSX, the free slot (global) data structure should be a stack (rather= than a ring)? =20 > hw_trans_mem_support =3D 1; > + } >=20 > if (params->extra_flag & > RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD) { > use_local_cache =3D 1; > -- > 1.8.5.6