From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00081.outbound.protection.outlook.com [40.107.0.81]) by dpdk.org (Postfix) with ESMTP id 42A3F58EC for ; Mon, 1 Apr 2019 19:41:25 +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=ryP3pJg0b2OBNvvWcIsmj8s65i0xTxFkd8Fejbk08Ig=; b=p+9+Qqykd2J0MIwchex7IxUW4JPWaIK7rEPJs4i1mEm2hoGGlGSdYseoqHRfWwaM2AYY8CMHsi+DKY6lP+e7c0tBmfCuusJ5nFJEKdaPrL+duZdOb10BVmTpMDOOPEDpk0P6MAjqy0uNA7x6SvEKDNokChqcE0bLSfpNkDWfxXk= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.152) by VE1PR08MB5038.eurprd08.prod.outlook.com (10.255.159.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.16; Mon, 1 Apr 2019 17:41:23 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177%2]) with mapi id 15.20.1750.017; Mon, 1 Apr 2019 17:41:23 +0000 From: Honnappa Nagarahalli To: "Eads, Gage" , "dev@dpdk.org" CC: "olivier.matz@6wind.com" , "arybchenko@solarflare.com" , "Richardson, Bruce" , "Ananyev, Konstantin" , "Gavin Hu (Arm Technology China)" , nd , "thomas@monjalon.net" , nd Thread-Topic: [PATCH v3 1/8] stack: introduce rte stack library Thread-Index: AQHU1CtVrsaMA7YCkEOnYy6dB4cOVqYgkw6AgAJQ+XCABNcfIA== Date: Mon, 1 Apr 2019 17:41:23 +0000 Message-ID: References: <20190305164256.2367-1-gage.eads@intel.com> <20190306144559.391-1-gage.eads@intel.com> <20190306144559.391-2-gage.eads@intel.com> <9184057F7FC11744A2107296B6B8EB1E5420D923@FMSMSX108.amr.corp.intel.com> In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E5420D923@FMSMSX108.amr.corp.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-ms-office365-filtering-correlation-id: e8af14d7-738a-4214-4064-08d6b6c94230 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:VE1PR08MB5038; x-ms-traffictypediagnostic: VE1PR08MB5038: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(366004)(39860400002)(136003)(199004)(189003)(102836004)(478600001)(72206003)(4326008)(229853002)(71200400001)(71190400001)(76176011)(54906003)(106356001)(6116002)(52536014)(26005)(7696005)(6436002)(25786009)(93886005)(4744005)(476003)(11346002)(3846002)(316002)(6506007)(81166006)(5660300002)(68736007)(446003)(81156014)(305945005)(7736002)(74316002)(2906002)(186003)(110136005)(6246003)(8936002)(97736004)(9686003)(66066001)(8676002)(86362001)(2501003)(486006)(105586002)(14454004)(53936002)(55016002)(99286004)(256004)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5038; 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: 909b4RzoReD7Chmo+5zM72T4yPYLit/anub72Pcm9Xd91t4CjYLh2i8Vqdtd00ryQ5yGFJfk/HS6X9O+SruMCmmaidNAH90akTLEclAIbz23IJqNCTpm+hvBgJK1VmypXJs2iSNRiAsZof4K7g3Jfe/l2ZhBNjov4an5kcWklywzUmtpsUTJhoexCCiMLj8p4QrK/0sHBv7grTZjsz8dNmMry77jnpIrPA+Um8vnv41h3Lc6uVc+fXJq3gUJ9s5vZNrXb1bQVyt4Q6BicfwyAJ2mwOkgePnUME/xsOFUv/bWQ0h3uXihbHzWcPFgeuppL0xzAZ802gaXy6cc6XLJEFtoiJre2xd16XOmU7dOzHT/Bv/Tixy/sCmN4FdXSZHhFSlI9YN/t68S/H9FJAzxzXCD5PIUj1GRVPXElVwiBS8= 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: e8af14d7-738a-4214-4064-08d6b6c94230 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 17:41:23.3213 (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: VE1PR08MB5038 Subject: Re: [dpdk-dev] [PATCH v3 1/8] stack: introduce rte stack library 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 17:41:25 -0000 >=20 > > > +static ssize_t > > > +rte_stack_get_memsize(unsigned int count) { > > > + ssize_t sz =3D sizeof(struct rte_stack); > > > + > > > + /* Add padding to avoid false sharing conflicts */ > > > + sz +=3D RTE_CACHE_LINE_ROUNDUP(count * sizeof(void *)) + > > > + 2 * RTE_CACHE_LINE_SIZE; > > I did not understand how the false sharing is caused and how this > > padding is solving the issue. Verbose comments would help. >=20 > The additional padding (beyond the CACHE_LINE_ROUNDUP) is to prevent > false sharing caused by adjacent/next-line hardware prefetchers. I'll add= ress > this. >=20 Is it not a generic problem? Or is it specific to this library? 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 70139A0679 for ; Mon, 1 Apr 2019 19:41:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 38DB45920; Mon, 1 Apr 2019 19:41:26 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00081.outbound.protection.outlook.com [40.107.0.81]) by dpdk.org (Postfix) with ESMTP id 42A3F58EC for ; Mon, 1 Apr 2019 19:41:25 +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=ryP3pJg0b2OBNvvWcIsmj8s65i0xTxFkd8Fejbk08Ig=; b=p+9+Qqykd2J0MIwchex7IxUW4JPWaIK7rEPJs4i1mEm2hoGGlGSdYseoqHRfWwaM2AYY8CMHsi+DKY6lP+e7c0tBmfCuusJ5nFJEKdaPrL+duZdOb10BVmTpMDOOPEDpk0P6MAjqy0uNA7x6SvEKDNokChqcE0bLSfpNkDWfxXk= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.152) by VE1PR08MB5038.eurprd08.prod.outlook.com (10.255.159.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.16; Mon, 1 Apr 2019 17:41:23 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::e0ae:ecad:ec5:8177%2]) with mapi id 15.20.1750.017; Mon, 1 Apr 2019 17:41:23 +0000 From: Honnappa Nagarahalli To: "Eads, Gage" , "dev@dpdk.org" CC: "olivier.matz@6wind.com" , "arybchenko@solarflare.com" , "Richardson, Bruce" , "Ananyev, Konstantin" , "Gavin Hu (Arm Technology China)" , nd , "thomas@monjalon.net" , nd Thread-Topic: [PATCH v3 1/8] stack: introduce rte stack library Thread-Index: AQHU1CtVrsaMA7YCkEOnYy6dB4cOVqYgkw6AgAJQ+XCABNcfIA== Date: Mon, 1 Apr 2019 17:41:23 +0000 Message-ID: References: <20190305164256.2367-1-gage.eads@intel.com> <20190306144559.391-1-gage.eads@intel.com> <20190306144559.391-2-gage.eads@intel.com> <9184057F7FC11744A2107296B6B8EB1E5420D923@FMSMSX108.amr.corp.intel.com> In-Reply-To: <9184057F7FC11744A2107296B6B8EB1E5420D923@FMSMSX108.amr.corp.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-ms-office365-filtering-correlation-id: e8af14d7-738a-4214-4064-08d6b6c94230 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:VE1PR08MB5038; x-ms-traffictypediagnostic: VE1PR08MB5038: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr nodisclaimer: True x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(376002)(366004)(39860400002)(136003)(199004)(189003)(102836004)(478600001)(72206003)(4326008)(229853002)(71200400001)(71190400001)(76176011)(54906003)(106356001)(6116002)(52536014)(26005)(7696005)(6436002)(25786009)(93886005)(4744005)(476003)(11346002)(3846002)(316002)(6506007)(81166006)(5660300002)(68736007)(446003)(81156014)(305945005)(7736002)(74316002)(2906002)(186003)(110136005)(6246003)(8936002)(97736004)(9686003)(66066001)(8676002)(86362001)(2501003)(486006)(105586002)(14454004)(53936002)(55016002)(99286004)(256004)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5038; 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: 909b4RzoReD7Chmo+5zM72T4yPYLit/anub72Pcm9Xd91t4CjYLh2i8Vqdtd00ryQ5yGFJfk/HS6X9O+SruMCmmaidNAH90akTLEclAIbz23IJqNCTpm+hvBgJK1VmypXJs2iSNRiAsZof4K7g3Jfe/l2ZhBNjov4an5kcWklywzUmtpsUTJhoexCCiMLj8p4QrK/0sHBv7grTZjsz8dNmMry77jnpIrPA+Um8vnv41h3Lc6uVc+fXJq3gUJ9s5vZNrXb1bQVyt4Q6BicfwyAJ2mwOkgePnUME/xsOFUv/bWQ0h3uXihbHzWcPFgeuppL0xzAZ802gaXy6cc6XLJEFtoiJre2xd16XOmU7dOzHT/Bv/Tixy/sCmN4FdXSZHhFSlI9YN/t68S/H9FJAzxzXCD5PIUj1GRVPXElVwiBS8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8af14d7-738a-4214-4064-08d6b6c94230 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 17:41:23.3213 (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: VE1PR08MB5038 Subject: Re: [dpdk-dev] [PATCH v3 1/8] stack: introduce rte stack library 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: <20190401174123.zzg0XCO6GO3ncxrlFKnbP4DRwTd__r81YaeLOQ_ozVI@z> >=20 > > > +static ssize_t > > > +rte_stack_get_memsize(unsigned int count) { > > > + ssize_t sz =3D sizeof(struct rte_stack); > > > + > > > + /* Add padding to avoid false sharing conflicts */ > > > + sz +=3D RTE_CACHE_LINE_ROUNDUP(count * sizeof(void *)) + > > > + 2 * RTE_CACHE_LINE_SIZE; > > I did not understand how the false sharing is caused and how this > > padding is solving the issue. Verbose comments would help. >=20 > The additional padding (beyond the CACHE_LINE_ROUNDUP) is to prevent > false sharing caused by adjacent/next-line hardware prefetchers. I'll add= ress > this. >=20 Is it not a generic problem? Or is it specific to this library?