From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <Honnappa.Nagarahalli@arm.com>
Received: from EUR03-DB5-obe.outbound.protection.outlook.com
 (mail-eopbgr40068.outbound.protection.outlook.com [40.107.4.68])
 by dpdk.org (Postfix) with ESMTP id 5E1A528FD
 for <dev@dpdk.org>; Fri,  9 Nov 2018 02:34:28 +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=VScDdkVdcZUTQqVu5HVI4SwNYWiaLPOKzl1tdvcwAbk=;
 b=rGqTQIR4kcuK8U445wxnVoV7u0106XcH+EJDj5jWkvjeE2Eihbn20l+BRhvK7oDA7W6xjSWI9Ai1DkdpLpKUW8yhpuX9c7AzSAbvyOCz9wM1b46zCfroP2s/y1x1SXwJolOg+zoP+u0DEz8AJ3RAFpVQq1/f24kZnczPQNjiei8=
Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.29) by
 AM6PR08MB3703.eurprd08.prod.outlook.com (20.177.199.220) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.1294.20; Fri, 9 Nov 2018 01:34:25 +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.034; Fri, 9 Nov 2018
 01:34:25 +0000
From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
CC: "bruce.richardson@intel.com" <bruce.richardson@intel.com>,
 "pablo.de.lara.guarch@intel.com" <pablo.de.lara.guarch@intel.com>,
 "dev@dpdk.org" <dev@dpdk.org>, "yipeng1.wang@intel.com"
 <yipeng1.wang@intel.com>, Dharmik Thakkar <Dharmik.Thakkar@arm.com>, "Gavin
 Hu (Arm Technology China)" <Gavin.Hu@arm.com>, nd <nd@arm.com>,
 "thomas@monjalon.net" <thomas@monjalon.net>, "ferruh.yigit@intel.com"
 <ferruh.yigit@intel.com>, "hemant.agrawal@nxp.com" <hemant.agrawal@nxp.com>,
 "chaozhu@linux.vnet.ibm.com" <chaozhu@linux.vnet.ibm.com>, "Kapoor, Prasun"
 <Prasun.Kapoor@cavium.com>, nd <nd@arm.com>
Thread-Topic: [dpdk-dev] [PATCH v7 4/5] hash: add lock-free read-write
 concurrency
Thread-Index: AQHUbO4hC1hG0V5Pe0K6GLHhoSzYDKU9/ZaAgAA/xYCAA9sPQIAAbsAAgAQrzkA=
Date: Fri, 9 Nov 2018 01:34:25 +0000
Message-ID: <AM6PR08MB3672D253F65AA1C09CE934C798C60@AM6PR08MB3672.eurprd08.prod.outlook.com>
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>
 <AM6PR08MB3672DD10D2BEAEB58599B7BD98CB0@AM6PR08MB3672.eurprd08.prod.outlook.com>
 <20181106090953.GA5671@jerin>
In-Reply-To: <20181106090953.GA5671@jerin>
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; AM6PR08MB3703;
 6:Xkf5k47w8LEjXaoax4r67bGCwOQYZJHZkZ7YWRtMkYO3VLbi40ut+hJItpsakzie2CM5LoZJDrQ5OYbCg1GKWcFayBxnG8V808S5AMew1ilRbQRsB6XF8qQFlXvmvU5MUQ7Mhu+mjY0pYF+5EuLtRwnxKUp1dMShukCcQ4Ego4kvaT5mn11Ubcf4y72HGsTho/w6pKtDO5xQb67XJZMATLlOxpAZzRwQt276yiOcT6g4kJBjhsQvMUjgoC27b0wpk7Mosw2lyu2AV0tQRl4QWrlJofG8feApoB/H9P5aTh3bjEQAUMUJvvb6Cnk0ltRjBFQpRAOrT2fnNE3I/vpi5q39i355VxZ3ExH3j2yYflDtk/uQzG7jQv/4tNHtFLNj/D5kAaO2dm+04sJhGvm3qITf6COuHXhH1NGF7EuNUh+NbaeReGcX2KP3o5wBRl38ydt3j5MG7D3b0TEYl2bEFw==;
 5:tlZnWCl/MLgKAPtiUdifzylEX0z45PCHRTMmH8kA8D6PF9Tp4uw4kjID87s+WFy6ktWY30Pjs7nnllubdYPJNpEWUPneuSWY4YqFH4lyY5X0GTAomdITpcRF5GQI8TsJ24MnGwmVuLOE+BO4ECHfM7vKEOTMNBo6BD0noPFXZAw=;
 7:gn33/FS6zoLWt4WW86aC9CaaQ0ihnJqaIRaATae51dfjeL+rrRCIPtd4vMaz8ure7ruEiqOydMWHWx9nTy8ryKtPNvler5gkFcUitVP3vrDRWK6gqXGpH28ZRAFNjjA+Ska0+qv5dVsgnBSAYnMTZQ==
x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR;
x-ms-office365-filtering-correlation-id: cb35fd34-947a-4807-b5fa-08d645e37be1
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0;
 RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);
 SRVR:AM6PR08MB3703; 
x-ms-traffictypediagnostic: AM6PR08MB3703:
nodisclaimer: True
x-microsoft-antispam-prvs: <AM6PR08MB37038B344BAF55B2F498283B98C60@AM6PR08MB3703.eurprd08.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:;
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0;
 RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095);
 SRVR:AM6PR08MB3703; BCL:0; PCL:0; RULEID:; SRVR:AM6PR08MB3703; 
x-forefront-prvs: 08512C5403
x-forefront-antispam-report: SFV:NSPM;
 SFS:(10009020)(366004)(346002)(39860400002)(396003)(136003)(376002)(199004)(189003)(305945005)(316002)(106356001)(76176011)(33656002)(54906003)(93886005)(6506007)(102836004)(105586002)(6116002)(6916009)(7696005)(2906002)(186003)(97736004)(99286004)(68736007)(66066001)(5660300001)(14454004)(3846002)(4326008)(72206003)(25786009)(53936002)(55016002)(86362001)(478600001)(9686003)(11346002)(476003)(14444005)(71190400001)(486006)(7736002)(26005)(446003)(81156014)(71200400001)(8676002)(229853002)(81166006)(2900100001)(7416002)(74316002)(8936002)(6436002)(256004)(6246003);
 DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3703;
 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: ln/MhsFU/5HD26P9bjRhl6po9xILprVF+6jfuLP9qIZCBPVnadx8hLt1X7v+6niwQ196BXlfhMzid78p3iQCM//2+ucfbOl/M9lifKN3aKUUK4wf4gV654ONiuX86g7t9uA6v9Anun30JT6J+wxFYehoLK6rosDcxRpD5AJGeS9/xwL9YAzz8hSEcvNPyptp9qSt3cmXFeuGo2gYz/wPhyqS1wpWmhwDDHLMstG5K6LNf/ote11Q0uaWxgSUsFuYNgw+2Ev2pxiZ1cTELQtbUDhS5N6NsHwnE0Htf3nrwG3n4u6ZnhluM1cSpkRW53Rpj8nL2RIbHwfy4LR4g/NCoLbNCAPjdspi9MoUBaAl+ZQ=
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: cb35fd34-947a-4807-b5fa-08d645e37be1
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2018 01:34:25.7115 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3703
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 09 Nov 2018 01:34:28 -0000


> > 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 work=
ing
> fine so far.
>=20
> Can you share that rules for everyone's benefit?
>=20
These are just few simple rules anyone can think of, but avoid the surprise=
s.
We identified a owner for each platform (we have this already in DPDK, even=
 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 if =
it does not cause regression on any platforms. Platform owner helps out wit=
h optimization where required as they understand their micro-architecture b=
est. I guess this is what is supposed to happen through the review process =
in DPDK. But making sure everyone tests it before it gets merged avoids the=
 surprises.

> > >
> > > 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 us=
e
> plain loads.
> > >
> > IMO, we should do some more debugging before going into exploring other
> options.
>=20
> Yes. But, how do we align with v18.11 release?
>=20
I think I have spent enough time optimizing the code. Please provide the fe=
edback and I will work on completing the fix.

However, if the new patch is not satisfactory enough, we need another plan.

You had mentioned about using function pointers. I suggest, we use the func=
tion pointer only for lookup function. Otherwise, it will be too much of co=
de duplication.
When lock-free is not used, the function with no memory-orderings will be c=
alled. However, I am not sure about the function pointer overhead. But this=
 will be a simple change.