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 C9350A04D8; Mon, 21 Sep 2020 19:17:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E28081DA9E; Mon, 21 Sep 2020 19:17:06 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 4C86A1DA6D for ; Mon, 21 Sep 2020 19:17:05 +0200 (CEST) IronPort-SDR: B1pjHQVmeDSi+A1+34HIOqMT0ci5CYm8NjNWsTOFAJuTnB8xVhPILJq8PH/u369Va0jFjJ9202 +OjnL6WFttBg== X-IronPort-AV: E=McAfee;i="6000,8403,9751"; a="148195690" X-IronPort-AV: E=Sophos;i="5.77,287,1596524400"; d="scan'208";a="148195690" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2020 10:17:04 -0700 IronPort-SDR: NmJ6lpvSJMfPfci+djap2Bk2J4Tv7QqlkoVyGyQLXT5N8DXQQbGd0GZQLRAN0OqSKswhiNCjbn MmG5I6RM290w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,287,1596524400"; d="scan'208";a="309145235" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga006.jf.intel.com with ESMTP; 21 Sep 2020 10:17:04 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 21 Sep 2020 10:17:04 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 21 Sep 2020 10:17:03 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 21 Sep 2020 10:17:03 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.108) 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; Mon, 21 Sep 2020 10:17:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WBeCEeIkzRU/rhWYpVmpFnkemrMcdOu8BNPSf1mFiN4wxdQYgoH8i5VFPTtnMIirnqsG7M2HWqFdx5py91yNS/TI1W6811kZyfL+JM/tP7kYq3vbgjr25Hm+zZ7cFXJz0W4SB4Oy82JaJJ17EGIBbY9SYSDrYHVU+/13t+dM3DszJCD21WrZSXZir80fRrcYOz6dz5Hg5jVj9xWrjyBtzbqiq0qQiGYWYOFOJ/15SziHQV5U97RWu32bwMOlZZbbngrnn+AvYfNhSLBZDqElaVptPtD6s/A/fSibVbAPGkI823Dc9E/lbitqpTBn2hiJbrsiyv3FuVCY2grUofSiFA== 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=ivQxD6TbHXjBpnOH796l6T7QP1xLuc69s59AFTopEWM=; b=WZZ0UB5XZbJ5OK7rma1ab7usj7YaHw6NzqUVulWC//fH5/uHMeyQHI5eMlnypeiHNFApbHdMfkX5K9tVytHeNmfgB5TstkvzeUx7kC3CuMhHa3zjQfHe7h+1Wup8+eunXqx2Y6TaNT86EE6GdFw9zGa0Ue3m3TD9RskiUkvdxXuyky1xjeVOB1CSHnTV/ClXB93UbcQ4tv1CVPrkVS1kkmd8PvBqLXfIarjweqWybrh4czp6UdG9r8LYTHPocXj74n6RiuclAeJkFX63fa5/4C+3SOjh7v7o9z+tOicLxO9IY9EKI40+XiIXHC8ChUR9ryrQf9+9sK4GyA74XspgCQ== 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=ivQxD6TbHXjBpnOH796l6T7QP1xLuc69s59AFTopEWM=; b=cZJNLioS1yVJhWaXN5d6G8XATp9lRRUc9d5lNKtq/9CfZAt051DM0Ht1J3CCN8uBeSnb7OReN7Whp63HtU/2zTXfNYfOTUQNBWqgD6blTz6wsjpDKWAbHxhSNXzX0W3cTB6KN6nr8XUZBPqYs6qyaAT/vRFiq82CAZ9wmVVyvvo= Received: from SN6PR11MB2574.namprd11.prod.outlook.com (2603:10b6:805:59::14) by SN6PR11MB2944.namprd11.prod.outlook.com (2603:10b6:805:cd::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.14; Mon, 21 Sep 2020 17:17:02 +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.026; Mon, 21 Sep 2020 17:17:02 +0000 From: "Eads, Gage" To: Steven Lariau , Olivier Matz CC: "dev@dpdk.org" , "nd@arm.com" , "dharmik.thakkar@arm.com" Thread-Topic: [PATCH 5/5] lib/stack: remove pop cas release ordering Thread-Index: AQHWiFDYcOJHJm23FkKk76VwS+VTLKlzWeKg Date: Mon, 21 Sep 2020 17:17:02 +0000 Message-ID: References: <20200911152938.8019-1-steven.lariau@arm.com> <20200911152938.8019-6-steven.lariau@arm.com> In-Reply-To: <20200911152938.8019-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: 2bab7002-fda0-4b73-5322-08d85e522841 x-ms-traffictypediagnostic: SN6PR11MB2944: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ir68h4QpZWfQxQuGhXpHBe50iiZh45+tC7K3EqP91Jjeuzvj0o7DPRfug4TDCLBUBoltvxj3qQsr6EzH00sjp8ZDlB8SaO6B9lC4roxJqYLWSG9yvvUBTtGtuzy+0CEcnK4l0omX5S5j1Qa5jZYf7HmgAw555Ff1EYs0zLjVmf0RPlibSfZf94jKQNcay1BBf5Zhm8n0VlB2AtwtKQhZiwd59rgR+MfbGhTmFQ2vyc+zit+atqJsE3szoWfV9s4MR4H+hJcoOwdHvoW5GxV3QGHNdoadRa7+ks6kQ7HTgRJc/szUqEa7tT8F9kSh4Wo1VMcnSyrowFR8EM3rQSQC/w== 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(8936002)(52536014)(71200400001)(53546011)(76116006)(6506007)(8676002)(66556008)(478600001)(83380400001)(66476007)(2906002)(55016002)(9686003)(66946007)(64756008)(66446008)(5660300002)(86362001)(33656002)(26005)(7696005)(4326008)(316002)(54906003)(186003)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: sYiaqjoLcK9YdAuDd+EHGiG6zfP7y1w34CdJcFswE4FDAj0VccupvlG6+ZEKMNqxbH2jNLToJaNWOXVABWoEaGSPRf6045u8fkijDwbDAHrp1Vsmf95cO4dwWMTewtQ7LYXNuReVCDYIkI0vdKBO9bJXcJoC9mFBN26lt1FPl1TEGv4OcGrEh2k/8Ff1OTp2r1O1JjZQet2s3y4sX2nlKy22YHGVkZP2Eo3vJKSl5ba6wu1bN+dAcdznvak6WejojQ7KG7+Kyy0vXzxPufqsIcLLaZI0MlNR3x8+2Uypg8kEiggy/E5cAnlb3T+8gOrGMJ9BjCYjU+8Jj/pDzEryvPTn3aEXMo8Sc6PIUiAHTUlCMtgrxyqT6Sbi8332X8ilYpnTtseJVRy1dCt1Nt/+u0vQY3cdc0bEBvdpGZGAVzWCVIwTtDsZjappIvafPFYRpDt2R/Y3W8phr0wgHLy1Oy6Q4iaY53rmjrGre51B8TWt228WQrMGDC2RrvKF60PMknXYNQhoWTaIS9VEZ7AXhruJnQQTxHXVNwk7HsiHcCfCw5n3TJG6ugrpTJiQINA5OI7BA4lrcMkpNVItHdIIsEkRtfg63cjMM2BqeZ9N7HfgL4FDSV2LmvQwl6CKPpLWGFeGgh5OPzVhpZd5elvcyg== 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: 2bab7002-fda0-4b73-5322-08d85e522841 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2020 17:17:02.7834 (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: Eog4BKU6i3x18jP2yOPJKPMAJfaWTJMWstly6O5KgkBom4eIy4Oz++gxDyWzDS81qxWFoBiqB2FBK7zH1YthMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2944 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 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 11, 2020 10:30 AM > To: Eads, Gage ; Olivier Matz > Cc: dev@dpdk.org; nd@arm.com; dharmik.thakkar@arm.com; Steven Lariau > > Subject: [PATCH 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. Please add a comment to this effect above the compare-exchange call. Depend= ing on this caller behavior for correctness is a little risky, but since this h= eader is private to the library I think it's ok as long as it's well-documented. Thanks, Gage