From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720079.outbound.protection.outlook.com [40.107.72.79]) by dpdk.org (Postfix) with ESMTP id D677D4C77 for ; Fri, 9 Nov 2018 10:28:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BpJnp8Ap8RRucSUY5oY5JJp94JX/RDMGMSfqyVJb++g=; b=i1KhVyk4vNkNDjobeNlzLvgFnSQge/cssFNKdRLwK7xs7noEF3TUyJOGrZ9fB0FBWct465Pcp+L2f3+zvMQ/5+O4mLHoS186xq/pDNkT20qc4O0ZizlquuHluw1WL3Yjnl0cMfNQIEMC27gqmsG5LXdb0l8hohiQGPQ5sjwQ/Qk= Received: from BYAPR07MB4997.namprd07.prod.outlook.com (52.135.238.214) by BYAPR07MB5047.namprd07.prod.outlook.com (52.135.239.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.25; Fri, 9 Nov 2018 09:28:37 +0000 Received: from BYAPR07MB4997.namprd07.prod.outlook.com ([fe80::2d56:eab:242f:fdfc]) by BYAPR07MB4997.namprd07.prod.outlook.com ([fe80::2d56:eab:242f:fdfc%3]) with mapi id 15.20.1294.034; Fri, 9 Nov 2018 09:28:37 +0000 From: Jerin Jacob To: Honnappa Nagarahalli CC: "bruce.richardson@intel.com" , "pablo.de.lara.guarch@intel.com" , "dev@dpdk.org" , "yipeng1.wang@intel.com" , Dharmik Thakkar , "Gavin Hu (Arm Technology China)" , nd , "thomas@monjalon.net" , "ferruh.yigit@intel.com" , "hemant.agrawal@nxp.com" , "chaozhu@linux.vnet.ibm.com" , "Kapoor, Prasun" Thread-Topic: [dpdk-dev] [PATCH v7 4/5] hash: add lock-free read-write concurrency Thread-Index: AQHUbO4hC1hG0V5Pe0K6GLHhoSzYDKU+WcgAgAA/tACAA7q3gIAAjxmAgAPbiYCAAIRsAA== Date: Fri, 9 Nov 2018 09:28:37 +0000 Message-ID: <20181109092821.GB4934@jerin> References: <1540532253-112591-1-git-send-email-honnappa.nagarahalli@arm.com> <1540532253-112591-5-git-send-email-honnappa.nagarahalli@arm.com> <20181103115240.GA3608@jerin> <20181103154039.GA25488@jerin> <20181106090953.GA5671@jerin> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [115.113.156.3] x-clientproxiedby: BM1PR01CA0121.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:40::15) To BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR07MB5047; 6:Ammwmtm+fsZUClpCrJQNm3vRkgVxxDBvlZSMYChAJLcGdfyf44Wau8Jx5Eio81Q2IQQJnjZkBLLdTvOLOfYo4rcQFwNDPjC+t52TXzBfW/WXmtIKZTLBJJU+bMNUbkPqDsAD7AidzyCWFr4bYujSsmv/ZYRYNVm5/7VE0UBqZcrLECn/Uc38875Vze1GWi2PSYXazGXnq/TOkT6RDaSWLpFOx1lGQUxssq6mej1Fxd6CUyPwKMmkKux4tuqnPrNMkB4KsiTCy9GRVuzPu7fxVuEY4swkSXH1qhl29sXEzoOw36d/UyOjWzDxBVbGB2ejKW+qswyHadfKKaKMY2RAZdUJcM0HxtICfnTTNX2fzOMqJtpSeJ6FwEdFhKNL04OiJTRw3ObxPFREnu6vlzjmUwDfSPecJKsMXHY+gjzgJNoutb7MfJ0IOJgjspOF+DBtPFGiNionkymJx/7Av7VQaA==; 5:+lvAmauvfaQFQQHegdkJNdJK5ueFqPH9iW6eYWbaOwyqVWJPD328yIrHcj3Al3ZUnKviVms+7DkY7vltWZHzVF4tIhy8we58mFM+5l0MGBP/wqRXzG9auRH4bFI6orT35aH2nxkW/vPfj9HTysVkm8xV+kvvZ4Z/VWWf1iQ2t24=; 7:ce68VUPbxqqX77M6PHAF8k2nxl0uPMiTJ8t8qnJN9XaG/u2VajOFCTbrnCStswVwqYgs7CVXDOBrVKhdlNYsZ64HzJ5DCR47UBNYkncBC/+njb7o1eYe+C9gh+EZd9alodmW39oNEp/q9r+xugx79g== x-ms-office365-filtering-correlation-id: f613ae30-df64-49b3-07df-08d64625ba67 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB5047; x-ms-traffictypediagnostic: BYAPR07MB5047: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699)(185117386973197)(104084551191319)(17755550239193)(180628864354917); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BYAPR07MB5047; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB5047; x-forefront-prvs: 08512C5403 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(7916004)(366004)(346002)(136003)(396003)(376002)(39860400002)(43544003)(189003)(199004)(13464003)(66066001)(6512007)(9686003)(229853002)(8936002)(54906003)(8676002)(81166006)(5660300001)(316002)(33716001)(6486002)(11346002)(25786009)(7416002)(6306002)(486006)(97736004)(476003)(72206003)(81156014)(966005)(256004)(6916009)(33656002)(14444005)(446003)(6436002)(53936002)(42882007)(105586002)(71200400001)(6116002)(106356001)(3846002)(2900100001)(71190400001)(2906002)(107886003)(52116002)(186003)(93886005)(1076002)(478600001)(33896004)(14454004)(6246003)(386003)(6506007)(76176011)(102836004)(55236004)(68736007)(99286004)(7736002)(305945005)(4326008)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB5047; H:BYAPR07MB4997.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: +DwwL6+WmElVpT0P/tpMz+zvTqbU02Om/5gP3meZ0pKBIuCaW8XW+eJvuFF+ZogSk9YmFn8mI+twT5q391lOoImTY7PSVyaBvUV/r0VGDOlPOjTvrLFLmFejVxNrOq7RWa6NJDoEs+wy7A+IkMS7Uhe9vId0DOgZmbDMjxqy5AEFvMq/WUmrmeuCnjh4Zi8lwOSRICacq2IO2Ia4dxbWA8i9u9VIUlE/R37/YgC6mo3Ca0C5uMO9/lhSFg63tjywJlysU1U1OcTDcJK7SMv3xMh0rOlRUwowyQQf9AsIWbDm3UD461qvRZ28yBqufGCVND4fV0RjWeoR+HjX5HQ+l+7mFz4TfF80gsEUFojWOvM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <94C048F74FACE8439DA74EB59A6A5FD6@namprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: f613ae30-df64-49b3-07df-08d64625ba67 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2018 09:28:37.7664 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB5047 Subject: Re: [dpdk-dev] [PATCH v7 4/5] hash: add lock-free read-write concurrency 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: Fri, 09 Nov 2018 09:28:43 -0000 -----Original Message----- > Date: Fri, 9 Nov 2018 01:34:25 +0000 > From: Honnappa Nagarahalli > To: Jerin Jacob > CC: "bruce.richardson@intel.com" , > "pablo.de.lara.guarch@intel.com" , > "dev@dpdk.org" , "yipeng1.wang@intel.com" > , Dharmik Thakkar , > "Gavin Hu (Arm Technology China)" , nd , > "thomas@monjalon.net" , "ferruh.yigit@intel.com" > , "hemant.agrawal@nxp.com" > , "chaozhu@linux.vnet.ibm.com" > , "Kapoor, Prasun" , > nd > Subject: RE: [dpdk-dev] [PATCH v7 4/5] hash: add lock-free read-write > concurrency >=20 > > > Agree. There are multiple micro-architectures in Arm eco-system. We > > should establish few simple rules to make sure algorithms perform well = on all > > the available platforms. I established few rules in VPP and they are wo= rking > > fine so far. > > > > Can you share that rules for everyone's benefit? > > > These are just few simple rules anyone can think of, but avoid the surpri= ses. > We identified a owner for each platform (we have this already in DPDK, ev= en across platforms) > Each patch submitted for Arm platforms is marked with -2 (VPP uses Gerrit= ) > Every platform owner tests on her/his platform. -2 will be removed only i= f it does not cause regression on any platforms. Platform owner helps out w= ith optimization where required as they understand their micro-architecture= best. I guess this is what is supposed to happen through the review proces= s in DPDK. But making sure everyone tests it before it gets merged avoids t= he surprises. I think, The very same philosophy can be implemented with exiting mailing l= ist method, if 1) Author Cc all the architecture maintainers and platform owners for any fast path change where it can introduce performance regression. 2) Author can CC the same list to request for performance check along with test command if area of performance regression known before.=20 I agree with last minute surprises are bad for both Author and platform owner. I think, it can fixed by above scheme. >=20 > > > > > > > > IMO, This scheme won't work. I think, we are introducing such > > > > performance critical feature, we need to put under function pointer > > > > scheme so that if an application does not need such feature it can = use > > plain loads. > > > > > > > IMO, we should do some more debugging before going into exploring oth= er > > options. > > > > Yes. But, how do we align with v18.11 release? > > > I think I have spent enough time optimizing the code. Please provide the = feedback and I will work on completing the fix. >=20 > However, if the new patch is not satisfactory enough, we need another pla= n. Based on the public release meeting held yesterday, RC3 date is on next Mon= day. I would suggest: - Send your exiting tested patch in mailing list for review. In my setup, The regression reduced to 5.7% from 24% - Extend the patch for hash bulk case as well and check NO_HASH_MULTI_LOOKU= P as zero with EM_HASH_LOOKUP_COUNT value as 16 or 8 for arm64. >=20 > You had mentioned about using function pointers. I suggest, we use the fu= nction pointer only for lookup function. Otherwise, it will be too much of = code duplication. > When lock-free is not used, the function with no memory-orderings will be= called. However, I am not sure about the function pointer overhead. But th= is will be a simple change. It may not be very simple change as we need to take care secondary process case as well, see struct rte_mempool::ops_index scheme. Since rte_hash_lookup() already NOT a inline function, so making it as inline and calling a function pointer inside may not attract much overhead. But we can tell only after testing(Which may be not possible for RC3) I think, in future it make sense to have function pointer scheme to avoid new APIs for different hash library and we can plugin other proven hash library like urcu based one etc to DPDK. https://lwn.net/Articles/573431/