From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05CFEA0548; Thu, 11 Nov 2021 09:13:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDA2340E28; Thu, 11 Nov 2021 09:13:54 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70071.outbound.protection.outlook.com [40.107.7.71]) by mails.dpdk.org (Postfix) with ESMTP id 2D01340E03 for ; Thu, 11 Nov 2021 09:13:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qLI0bvgDaky1vuQ+GtJTH9JWHms/wGWA+WL3+J0ZVCY=; b=I430ydE4oNZ787mEswy16Ll+yofQ1IYFV/vDMk0TLFzX6+X4d3h1pO+jyrGQ1tp05TX2o9trVhR32m45i7tIurWuxoLiRaOxBVW8TY+DbfuzPwhoHON+6r+nS4aprO1zj8ResaZ3SzkrrRAf1HHXpLSjYZB23QCD94FvhGWQiLI= Received: from AS9PR06CA0377.eurprd06.prod.outlook.com (2603:10a6:20b:460::22) by AS8PR08MB6199.eurprd08.prod.outlook.com (2603:10a6:20b:296::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Thu, 11 Nov 2021 08:13:49 +0000 Received: from VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:460:cafe::da) by AS9PR06CA0377.outlook.office365.com (2603:10a6:20b:460::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16 via Frontend Transport; Thu, 11 Nov 2021 08:13:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT058.mail.protection.outlook.com (10.152.19.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Thu, 11 Nov 2021 08:13:48 +0000 Received: ("Tessian outbound c71e1a752bff:v108"); Thu, 11 Nov 2021 08:13:48 +0000 X-CR-MTA-TID: 64aa7808 Received: from 6f21069f87f1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D13DA628-E758-4BE6-993C-1D538445A7E7.1; Thu, 11 Nov 2021 08:13:47 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6f21069f87f1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 11 Nov 2021 08:13:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TaVfQqUmcO/3vpks/fkeSgUn/SH68GWgYKnCTgXIAwjpAwdr5flyqHkTwxUv7TigBt0mXhbZBsWJy51BHYK9aaN4qXAeYZISI7qYN5ik43ZHmKqB21RF7+UKKN3NAiqby0ba4qhGfXLN8V3szFIUNW9Gv4bnMaQZrvSPm+Vnq/rDckGO+H9syj572uSWWHR8UrJFUdjyLgk2eckoMyw/kdK56njKW+gh+MBLjK6qWo1lalzFG8LrT/O3htLz1W5Oj8D1w5zaGklkorV07ra2zDlVG2ZK6gLejC/Qkhecy7+HJ9XgXZ34x+iuZhLbd0ZJB9tXHhzZBg44PrJ89G6zBg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qLI0bvgDaky1vuQ+GtJTH9JWHms/wGWA+WL3+J0ZVCY=; b=TfKy+nnIiywUBxt+bnbIHv8vT7v6PloGsiknoiBuo14pxHwt1lPgmXNiwT5cy5Xi5lH7WuYzw+37+VRToZdTVdJM9mj/TenteviYZ2bh7yKNHr3OrNjAS6Mej9upHZxaR+2UsZ3vxZtq0JcmZLezUAYQrUEXXhvFmK9aYQX4WvJAfxO6tOlwvox+Ml6U18ZZAStj1hE2ZDtNJCqn7eIns9gIrprj8uQPOkOQ3QdPVE9VWHleiJYNtFC6WITgXrNIOEa6e6GshvY4IOwKa/hVryrjF/DMURvBn2GffOeu6gn2CFkZb83LBLbahg+GY99/L/ez2jlYUbUyT5FV05xV3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qLI0bvgDaky1vuQ+GtJTH9JWHms/wGWA+WL3+J0ZVCY=; b=I430ydE4oNZ787mEswy16Ll+yofQ1IYFV/vDMk0TLFzX6+X4d3h1pO+jyrGQ1tp05TX2o9trVhR32m45i7tIurWuxoLiRaOxBVW8TY+DbfuzPwhoHON+6r+nS4aprO1zj8ResaZ3SzkrrRAf1HHXpLSjYZB23QCD94FvhGWQiLI= Received: from DU2PR08MB7287.eurprd08.prod.outlook.com (2603:10a6:10:2d6::20) by DB9PR08MB7164.eurprd08.prod.outlook.com (2603:10a6:10:2cd::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Thu, 11 Nov 2021 08:13:39 +0000 Received: from DU2PR08MB7287.eurprd08.prod.outlook.com ([fe80::455c:4503:6b3a:1b05]) by DU2PR08MB7287.eurprd08.prod.outlook.com ([fe80::455c:4503:6b3a:1b05%8]) with mapi id 15.20.4690.019; Thu, 11 Nov 2021 08:13:39 +0000 From: Joyce Kong To: Honnappa Nagarahalli , "thomas@monjalon.net" , "david.marchand@redhat.com" , Ruifeng Wang , "konstantin.ananyev@intel.com" , "rsanford@akamai.com" , "erik.g.carrillo@intel.com" , "olivier.matz@6wind.com" , "yipeng1.wang@intel.com" , "sameh.gobriel@intel.com" , "bruce.richardson@intel.com" , "vladimir.medvedkin@intel.com" , "anatoly.burakov@intel.com" , "andrew.rybchenko@oktetlabs.ru" , "jerinj@marvell.com" , "declan.doherty@intel.com" , "ciara.power@intel.com" , "xiaoyun.li@intel.com" , "nicolas.chautru@intel.com" , "maryam.tahhan@intel.com" , "reshma.pattan@intel.com" , "cristian.dumitrescu@intel.com" CC: "dev@dpdk.org" , nd Subject: RE: [PATCH v1 09/12] app/compress: use compiler atomic builtins for display sync Thread-Topic: [PATCH v1 09/12] app/compress: use compiler atomic builtins for display sync Thread-Index: AQHX1b11zwylGI1zrUiBsxULXmgCd6v9/B4A Date: Thu, 11 Nov 2021 08:13:39 +0000 Message-ID: References: <20210802101847.3462-1-joyce.kong@arm.com> <20210802101847.3462-10-joyce.kong@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: FA2395C7164B6B4F9FAD14BD22C57CC6.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: 1c6249f2-05e5-4cd7-efed-08d9a4eb30ad x-ms-traffictypediagnostic: DB9PR08MB7164:|AS8PR08MB6199: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: uCG7c6Mn6c4/DsDfuVqa4J7gpLblFoWuKEmuVzrr44oy9D1bR5oVHTfIw6WHIqUt51yAYSPk2eg5wvutXt7nLavQK4fgLmfZgkPV4CI8gJzwxXx/txUTuRe5H8fljze/cokrGMrcx+9r7gcmcfqCPwjptPziHpAyRJDterao13tV1j6Q7wDhOCUuXrq2gJOXvXAZhLtULm8mWZg6nSVVaKoCt4lRWMS4HoVn49o+qiCm8Bk/VD7mtG3rjawQC/3KJOGvI+x80bx8KZdV8UEW9n7Q4rcVt/5/Sb/ayiAxPWaNl2EVbg9v6xXvkPUW30zUV+RPRnrCHFL2yDGiepfYM2No7aYqBUCcgKExOfYis1XjBpwMXZtVmThgiHbYThocwGJJxdwUh+1oqDLubBL97fdw0WUKOc+dgg73YE94m18/z5heD4gZGQGnKIGCnL2XT8YxJHwaAtzLln870mqkqGOE6lfe1li2t4DVdVs5XDT8cMxKIuGowLB8nFIVzilRLCm4IhTe1MDQy8BlMBhcpKLRmsguEhUGClx8INO17Q+5EFHqUokyHX1MnkoTWJ5GPpU8leKaCmH1m4FKkYhUcfPsxjuRD0TyeXkEhrV1DeVDAuDvppUWIPCIFPyO/A69I1sWjqdfAt8WQdxpnmXAp8a2EbKeIGQbADc/WeSZftE55qGDEQupaS3BrXaeFlqjKAbxcu5IQTGdSPAoPuhOOABhxKz9yeG+iuO3eaKSp08= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU2PR08MB7287.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(186003)(71200400001)(55016002)(26005)(6506007)(7696005)(66476007)(38070700005)(66946007)(66446008)(64756008)(66556008)(86362001)(8676002)(76116006)(83380400001)(8936002)(9686003)(54906003)(52536014)(921005)(110136005)(7416002)(4326008)(5660300002)(2906002)(316002)(4744005)(38100700002)(508600001)(33656002)(122000001); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7164 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 0c1f1c32-def4-44d4-b1f8-08d9a4eb2ae8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mz6xO/7J2SeQ3IXcZKhjfk+lMSK6mDIejJDklK9HRRnDWJQjIxYM13xnOCZz7Z88RRJGy9x3pf4Xd0koyEPzswF8t9U9DheKAnuGSYPgh3V0W3UOYJ4cfATmo5ft9nj6cJaIs8+YQQqOP2hZlOX9u32A7Z4TP0FYwczlX1562sMLg4yeatkLglRfVAg9SABH+cvdZi9O4pfyeKFEUQgtV921xaHpqobYSvjR9QKvOz9AWGl9ePV5N813yixHeZQr2UG5i/5J9xQ/M/4YFHLIST2zVcOQvzpNLd/IeUAXF/pLPst8Cdcc+r2WpCSWTSN4pb9d/hN3uzWfx7SLhkOxjU5EyE5myxccN2eRjdrHx0w7mpkEgf2VrD7YSaQs6qE/iHpErWImHDm8a8ElGXUwT1lGx/DckwbymLI3sOrS8HuR8fuQx9o4OhWWiRpUABk4jmWI3e7IxcA0qKMOeyYIkSi/dP5rGlnI4iijK4OmHke7jxbfHGo9SMlXHvH4nm1FjaD9/CsIaXeATZZvNdKWumjsaEKneko3+Uwp8FC0SA8fVxA4dFNvrxXyDekUU2qBK5HeQ37AIy73zqrLt7Rmkojb1cNwme8B97sZMilnHADb4Dvb0+XCrJOXS/j/QRZTBWgnQ+f6w+ihXcOS6R2Z/bcCHJPehHXiRZsXirPdHkxSC3OT0OkY9J4rtB1QPS6qVFZvLa6Dd2sJS2BS2gx9pCI3syrKiZpLU0q+Iu6/tFo= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(8936002)(52536014)(6506007)(70586007)(316002)(47076005)(54906003)(81166007)(70206006)(356005)(82310400003)(8676002)(4326008)(86362001)(33656002)(186003)(9686003)(336012)(2906002)(508600001)(83380400001)(36860700001)(921005)(5660300002)(26005)(7696005)(110136005)(55016002)(4744005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2021 08:13:48.9541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c6249f2-05e5-4cd7-efed-08d9a4eb30ad X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6199 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > >=20 > > > > + exp =3D 0; > > /* R E P O R T processing */ > > - if (rte_atomic16_test_and_set(&display_once)) { > > + if (__atomic_compare_exchange_n(&display_once, &exp, 1, 0, > > + __ATOMIC_RELAXED, __ATOMIC_RELAXED)) { > I think we can re-organize the current code which will avoid using atomic > operations on 'display_once'. How about the following code? >=20 > rte_spinlock_lock(&print_spinlock); > if (display_once !=3D 1) { > display_once =3D 1; > printf("\nLegend for the table\n"..... > > } > printf.... > printf.... > printf.... > rte_spinlock_unlock(&print_spinlock); >=20 > Rest of the changes look fine. >=20 Will send out the next version with the changes.