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 C7139A04C0; Fri, 25 Sep 2020 19:57:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E243C1E9DD; Fri, 25 Sep 2020 19:57:36 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 1C1B91E93C for ; Fri, 25 Sep 2020 19:57:33 +0200 (CEST) IronPort-SDR: G/vMrMu9YbApP2wsd+7IkbiCcqRgOm0+GG0ErqH1Yam6Ph1PbJmmlXxLKRgw02lWRXl/Se2nrK F6281C0klU7w== X-IronPort-AV: E=McAfee;i="6000,8403,9755"; a="158999858" X-IronPort-AV: E=Sophos;i="5.77,302,1596524400"; d="scan'208";a="158999858" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 10:57:25 -0700 IronPort-SDR: OlOhG/Jx/hF1oKDf0RTa+Uc09UwGa6JLb0WYDDIq3g8oOdQpa/o0+VRiRkne//iy9MLH8vwCFq AGyqQna/LpTA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,302,1596524400"; d="scan'208";a="348492475" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by FMSMGA003.fm.intel.com with ESMTP; 25 Sep 2020 10:57:25 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 25 Sep 2020 10:57:25 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 25 Sep 2020 10:57:25 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.59) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Fri, 25 Sep 2020 10:57:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JGBc/CGYBwzO6PiRriiuGU1bbYUrtsIRKNgRbNhYgkklESFqyKsfte2B/axb+gZMcQqQ8/HEGxqyKcxMQDkK1DbwlPNkCcxGYP+ewCESYGKRu9447SUOiQhhQ5LiC86+pIpP8bYuuTOgE5JsC83AKHDNVoFx1xo1GRq5QNuvxu1HK+5oz+Pf0ETLKpIfgPJbGUasyms76WbfMp8mgGxr+IlRw4xqDtSvfjBpShuPlor3YMa8PtC/qWRFnIn4uI6cvwxsPg0xiTnkO5+Q0tyDLf+TGLpLiNM2pGEzIwSwhVEa0qH4Srn47v1LU2MsMORajP3s8c2AZudPMZcPeecMhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aHCqRfK0mA5jRkyVgtW4StVjhGpwmZFh8vU6U+CSJb8=; b=lKS84ZD90O68xzxJhtYGsxPtY3q8S3PFdf/7l7Lx4sCEBNUfrma3+py7KI5JzbwIyLd9QH17Dd1/GVtLiwtwiSMMVMyKbWxZIIm4poaE5P/rK+Tee31uhtjJxBdtenGj3zArI6Lc8iMtrbV9gp5S1kaiBOlYgawxL31say0Aas4PEkAU28knv5HTWn6I1rSoAlD8B9eU4aGs0nDympCCkjNBq2MCJpRuGuBe9xqR7iAjwrdFfsp0tnGZ0cERo02Me0uYhHMlBsCHE91I6WuCnvEKf7NfH/vKuS4y2nwtO+edRP2AWBfG5M6RzJIdxpXpDnRK9wXxoMUY759dnsy8mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aHCqRfK0mA5jRkyVgtW4StVjhGpwmZFh8vU6U+CSJb8=; b=A00PHBQzLSZFuDJ1hlCjB9LAEg7GvdPVMdBXQojEHPay3Stt9BGFXvRNQTrIgPaXVESTBuee8YAWu+td4z1qN/1dA9sUMLPngXuvMJUV4m4qL0k4BcidDvnpR0zjrm915noPM+PswuFlAistkBFl87lv4TcFjUs75qVhp3FO1cA= Received: from SN6PR11MB2574.namprd11.prod.outlook.com (2603:10b6:805:59::14) by SN6PR11MB3022.namprd11.prod.outlook.com (2603:10b6:805:d8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11; Fri, 25 Sep 2020 17:57:22 +0000 Received: from SN6PR11MB2574.namprd11.prod.outlook.com ([fe80::54:b143:c75e:41bd]) by SN6PR11MB2574.namprd11.prod.outlook.com ([fe80::54:b143:c75e:41bd%7]) with mapi id 15.20.3391.027; Fri, 25 Sep 2020 17:57:23 +0000 From: "Eads, Gage" To: Steven Lariau , Olivier Matz CC: "dev@dpdk.org" , "nd@arm.com" Thread-Topic: [PATCH v2 5/5] lib/stack: remove pop cas release ordering Thread-Index: AQHWk2ORXkL8x+0/lEC3xJkm2zwYR6l5o6xw Date: Fri, 25 Sep 2020 17:57:22 +0000 Message-ID: References: <20200911152938.8019-1-steven.lariau@arm.com> <20200925174340.10014-1-steven.lariau@arm.com> <20200925174340.10014-6-steven.lariau@arm.com> In-Reply-To: <20200925174340.10014-6-steven.lariau@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [68.203.30.51] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f3a59d0e-b728-431f-8b3f-08d8617c7478 x-ms-traffictypediagnostic: SN6PR11MB3022: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k61ySwmf7ZSQb3v0QVI5/AoTAThrcYlETR8t4H6saSzZaJf+sTtywHVoLLu9rbsR6CQercCbf7k94uucSsdO7zN1mOUG6Ldp+SMShIUQmTPSuz/lt/yWtQN1tdoEYB0zwYnOJcVJEuB73zlmULNRYAUB+KxBRbvxfWBxzuTMc8sj4KA8u42YBq0QUUbyWo20WzANyUZnTWbIhOAgNNf0Tk8mc7lVZBc0N8N84AOFlM+eStVRE3RoFTl3aa/3ntS4WIQ2HhpTooZwWKGNrEKX64ePehOSHaP8mH6KLF+Bd5+mncsLY3tqIX1QLT2xv3iFRmNIiWP5qhEPBZB1TZycVA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2574.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(376002)(346002)(39860400002)(83380400001)(316002)(6506007)(8936002)(110136005)(478600001)(53546011)(86362001)(54906003)(9686003)(5660300002)(26005)(8676002)(33656002)(7696005)(52536014)(186003)(66476007)(2906002)(64756008)(66556008)(4326008)(71200400001)(66446008)(76116006)(55016002)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: a3kDPbY1gNeVOT/hPk3ljkCBeeycn5duSEy09vumdY1ucbxjbVyDe28RnvoyH0HbeyqhxASK/cadhsmtJl9ILDIXfdag4zbP5LGYSMOo7PWmyEuGsvI5lqPsS8dh/mKOxtHMaO6r+q/7PrA4zVefu4nAZIvG/5/IrSxKXvmw2kQg0G4SAmIzW1q2IJTmylgoYSW5h1TuMZRdPCR6gmS8nWTa0EFEe7R3kfHbMW54xj/5CcD/4Dv1PskElJfRp0OizONLN97Dn6aUeG+b4fgEwT81pUIDuYILBD+cyQ99BMRZbRvz5cctLCOGZw14o62pC7+aeuJ73z/Uy/BP9tmVIL81k+MPkBQGsU3xuRRPDEpsTJrFJ7jwRC1x0cCMi4w4mhjahtaE5e9w72TvMlDA5pz8HQ0RpMShYU38Z/EZvJiHswfwVAVSKlLDadkLPKXefsWWECXJq92KC+ryATIqwMw4VqWu4vqwGCY2S7hLHWdV4i6zx8hF2kKBmqFHp/7p9raYjYCQx8BZirKcSpjmvMUfu/w22vJMdL6sn+KK3Xh5CjLy9kgceDoOwQDRIP3a22ndj7/R3cUBL1QcrqlLNURFFDbEVns6vuILzLx6gEu+X4X1+qEAxTLPhhoQQZ57rJ2BcjOGO8E2OHiSwxrR2Q== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2574.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3a59d0e-b728-431f-8b3f-08d8617c7478 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2020 17:57:22.9272 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sEiO666dAFyJfIK88PdX4xIJiutK8YnzXWd6RsHyjILANUGLjj/cwaHkT88E9JOlALkWV2rYi0rFSx4iiKJIyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3022 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 5/5] lib/stack: remove pop cas release ordering 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" > -----Original Message----- > From: Steven Lariau > Sent: Friday, September 25, 2020 12:44 PM > To: Eads, Gage ; Olivier Matz > Cc: dev@dpdk.org; nd@arm.com; Steven Lariau > Subject: [PATCH v2 5/5] lib/stack: remove pop cas release ordering >=20 > Replace the store-release by relaxed for the CAS success at the end of > pop. Release isn't needed, because there is not write to data that need > to be synchronized. > The only preceding write is when the length is decreased, but the length > CAS loop already ensures the right synchronization. > The situation to avoid is when a thread sees the old length but the new > list, that doesn't have enough items for pop to success. > But the CAS success on length before the pop loop ensures any core reads > and updates the latest length, preventing this situation. >=20 > The store-release is also used to make sure that the items are read > before the head is updated, in order to prevent a core in pop to read an > incorrect value because another core rewrites it with push. > But this isn't needed, because items are read only when removed from the > used list. Right after this, they are pushed to the free list, and the > store-release in push makes sure the items are read before they are > visible in the free list. >=20 > Signed-off-by: Steven Lariau > Reviewed-by: Dharmik Thakkar > Reviewed-by: Ruifeng Wang Acked-by: Gage Eads Thanks, Gage