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 C5EB8A04B1; Wed, 4 Nov 2020 22:20:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A182E2C16; Wed, 4 Nov 2020 22:20:20 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2058.outbound.protection.outlook.com [40.107.20.58]) by dpdk.org (Postfix) with ESMTP id 08E062BFF for ; Wed, 4 Nov 2020 22:20:18 +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=ZkKFSzRjtnCY9VpqfndJRZu6+xfe18kzthSBNgXeRrQ=; b=FjmvIpBGi3tb2+pR7ejNu/SqU/wrO0RUW2fb+VRxSkBPgZdGWrEPqI6I0iJkTbbiLM7FLd535e6iL4WQQoMQ02C7fZecAiga8u1MTksSb62P5hoko4K5aahiPXLjKCnz6UThD3YwbZySMr1LR80zw0XbFkg4Pbp3roFXlKUccXs= Received: from DB6PR0301CA0080.eurprd03.prod.outlook.com (2603:10a6:6:30::27) by DB6PR08MB2870.eurprd08.prod.outlook.com (2603:10a6:6:20::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.29; Wed, 4 Nov 2020 21:20:16 +0000 Received: from DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:30:cafe::61) by DB6PR0301CA0080.outlook.office365.com (2603:10a6:6:30::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.19 via Frontend Transport; Wed, 4 Nov 2020 21:20:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; 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 DB5EUR03FT018.mail.protection.outlook.com (10.152.20.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3520.15 via Frontend Transport; Wed, 4 Nov 2020 21:20:15 +0000 Received: ("Tessian outbound c189680f801b:v64"); Wed, 04 Nov 2020 21:20:14 +0000 X-CR-MTA-TID: 64aa7808 Received: from d4b6ce341e79.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 20A4A42A-A4A2-459A-B0D7-69C2C456DA92.1; Wed, 04 Nov 2020 21:20:09 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d4b6ce341e79.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 04 Nov 2020 21:20:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kHqOJZ7sBzWzHnG1MIiFE+vtQ+nN3jE+AjSIli4D4DbTJmZUhgfgYEOlk07+DxJ5Sn54uFoRJgbpeDrMlSM68uJax84Gnmp7wCMEck4jmKgxNAU7ug8ZPRyl27lHTHLkcr6NLsx98Lzem+xR2GFarqab6aKxP3e8/OymozSD7enHyUErAe2AKEamQU0T/4/yB1CzwmNh/bZggieeOgNh86DImYR4/suC5/BxLaTSc2ZWMuhgZcjgHbTdM1JoN0K0XZj4ZEWRZo+dcWowyw+se9ETFzICQVZ5gblV95rclMtcqmm3cgP6aZPjBjTIed0vATz4YEckjRWEb3229XE16w== 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=ZkKFSzRjtnCY9VpqfndJRZu6+xfe18kzthSBNgXeRrQ=; b=Di9+Ojl8nxRfmz391X2bV/GIE0uVnGUGuyPthlypurYeWVXukDCLPEJdm1tZDsZfGIDsvRHpIkV8u9X6M3+1yuzVw/lf5TDNecFC3cG41lfc8PlGvdJMYVfWaUFWNPiCtnVVkHHh94iz17OifeGN01ro7LCKZc5PGMcaqmVqegvcdVqB1VZ4xJYaqN6rwGguJ/HR+mZX7SFZ4s4b+5U13TdxQXJZgI27h5Y1wpqBnD8Qva2i63KM7a+LvRJc0Pm+FDxmPBz9/DVhgfk8HYxSEcA+Xn8yVZakRmI8GjUKeX/l5VgSTY+r6kBJwkgmTu+hSYd9mgcZ6THaf4G6Yz4F6w== 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=ZkKFSzRjtnCY9VpqfndJRZu6+xfe18kzthSBNgXeRrQ=; b=FjmvIpBGi3tb2+pR7ejNu/SqU/wrO0RUW2fb+VRxSkBPgZdGWrEPqI6I0iJkTbbiLM7FLd535e6iL4WQQoMQ02C7fZecAiga8u1MTksSb62P5hoko4K5aahiPXLjKCnz6UThD3YwbZySMr1LR80zw0XbFkg4Pbp3roFXlKUccXs= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DB7PR08MB3339.eurprd08.prod.outlook.com (2603:10a6:5:1c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.27; Wed, 4 Nov 2020 21:20:07 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d%4]) with mapi id 15.20.3499.032; Wed, 4 Nov 2020 21:20:07 +0000 From: Honnappa Nagarahalli To: Olivier Matz CC: "dev@dpdk.org" , nd , Honnappa Nagarahalli , nd Thread-Topic: [PATCH] test/mcslock: remove unneeded per-lcore copy Thread-Index: AQHWssyXYKS3pQyOBUyejxb/wxvDDam4QZHwgAA01QCAAAPcUA== Date: Wed, 4 Nov 2020 21:20:07 +0000 Message-ID: References: <20201104170425.8882-1-olivier.matz@6wind.com> <20201104210352.GA6890@arsenic.home> In-Reply-To: <20201104210352.GA6890@arsenic.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 08A236C3594AD141B54BF123114C90FB.0 x-checkrecipientchecked: true Authentication-Results-Original: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [217.140.110.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 826ada66-8464-43a6-0121-08d881076c97 x-ms-traffictypediagnostic: DB7PR08MB3339:|DB6PR08MB2870: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:7219;OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: jAAZ3HGKtoxKOdXssL5Pn9EvXjUgMakaTaMmC13oBaYT2pJfpXGouQHvlXXcflRtwadXkjfpHNH8OUvvtzjOs+MNCfC4DR2CaQKzKo0j6bE6wK+9Jud2gZQuOWNOubKoEBsT+hmqIBbRBmekWoBPU6CJcCBoLHuNE3OgJj44RLaHhot5pP0j7bxwPwpOhQI7d2v8u5j+DJMFr/jxMI3lRigsaGMct6LsDkcsBsOHI0zAgJ7kPU1xHGfYi+n90kkrb10WUCnTm+1dpJepZJ4QaipS7Y731tF2zbep7/U6WR0U5IjSzT43D4LeFb3IMEypZ9fsSsbYHH+3qQIDlRRffA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(136003)(396003)(366004)(39840400004)(4326008)(8676002)(8936002)(6916009)(478600001)(2906002)(186003)(86362001)(26005)(6506007)(54906003)(7696005)(55016002)(9686003)(71200400001)(66446008)(64756008)(66946007)(33656002)(66476007)(76116006)(66556008)(52536014)(83380400001)(5660300002)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: yPHIL8II5LV2BxBKMZAw/2lK7DBbW/cxGY2WQm+TRApmpZw500biEmlr2kAmaK7hb0VCJd+SrelnS7EzYOmnpZJgCOGUJemQyOKRyjDtasMEtd6b/XV2WzboNTpIiGrjtXU2rlw0WtRrE5sacdvebexdVvRsdcefk1nwdzEaq8lCKB8TMaJZbNfsw//WEBsmp4+3GvNYvO7AQc7ZBRpCTO0s9cFLEq/G9ss92DJKNOG8iOZoA0rBln9WFQ1AUZsYWQMCMbFDXVDO1WJ0E+SClVg2AyehFkVT55YRdN6u+qpqcorqsH53QptjjeBfTrWonf6GYB8ehwJPcZm8ukwRXR8VKWx+FRhk5vXPnkgQM0r9gP0MayKpNNp9TYQxkL9rQsUGQROSEv3abEROCAmZdnnXsGWwYfU2OlB9FkhCYIAZpvKo2JzLqKbcPTFqXOwCiGM7Kmlt4A7rw1RSx/sst2+YLISUUtGvn4+SoI4HqibmqFM5GprIZhT04uGTWKLIzsWSUXJgiwaXjZPMjmDXijlIxVH5cS4k8DYxw/v3sTBA75bdl4r/mCtuQaQN2VY1FLWY1HrTLhuY8qX0A+SNIaT4HPfikxuuYCkPE/2NkFL3O5DXahLHwot/YwCfGKqAUAloUlCesZoMmq7Z/aCuBA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3339 Original-Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a2ec9347-caf2-438b-b05e-08d8810767ae X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e2R6dLWo9wmFcPIVZ5w/s+lBYI/k3MbLvhx8xHGYHSBo0bBx+iUhmxqTHLa17XjnBccH4jLve69MccJYnoRGvopu/5XhrFJZPzGHR/stP206NeMLhBb8eapS7E9NzROR9mU/qdP7rCY+HeBL0VdYdk8b+XVE04b58Z+aKN8Ta7PJiZMdn833uhKBAbG6nVl+0hv1hsV3W1ZKSaZo2VYhljIjs4njRrJBTwl6aDblFzeqRQV05EEdfkBB6w8CRqKt5xTIpTWrCf0GI4LCWrttxQmeoolJrqxsPFJHgvvGg/l74Q6QqsbHE3P0VCdG48SLa9m/qnd+OZBvTI7R4DQgS32nrwA/El2cs3wamVXefooku9QG5lpyjGPoxHm/6KZLNlPicamM71xK9A2wWNQUjQ== 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)(396003)(39840400004)(136003)(376002)(346002)(46966005)(316002)(54906003)(47076004)(83380400001)(5660300002)(33656002)(55016002)(9686003)(52536014)(26005)(336012)(86362001)(6506007)(186003)(70206006)(478600001)(4326008)(2906002)(7696005)(8936002)(8676002)(81166007)(356005)(82310400003)(6862004)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2020 21:20:15.9444 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 826ada66-8464-43a6-0121-08d881076c97 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: DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2870 Subject: Re: [dpdk-dev] [PATCH] test/mcslock: remove unneeded per-lcore copy 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" > > > > > > Each core already comes with its local storage for mcslock (in its > > > stack), therefore there is no need to define an additional per-lcore > mcslock. > > > > > > Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test") > > > > > > Signed-off-by: Olivier Matz Reviewed-by: Honnappa Nagarahalli > > > --- > > > app/test/test_mcslock.c | 16 ++++++---------- > > > 1 file changed, 6 insertions(+), 10 deletions(-) > > > > > > diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c index > > > fbca78707d..80eaecc90a 100644 > > > --- a/app/test/test_mcslock.c > > > +++ b/app/test/test_mcslock.c > > > @@ -37,10 +37,6 @@ > > > * lock multiple times. > > > */ > > > > > > -RTE_DEFINE_PER_LCORE(rte_mcslock_t, _ml_me); - > > > RTE_DEFINE_PER_LCORE(rte_mcslock_t, _ml_try_me); - > > > RTE_DEFINE_PER_LCORE(rte_mcslock_t, _ml_perf_me); > > > - > > > rte_mcslock_t *p_ml; > > > rte_mcslock_t *p_ml_try; > > > rte_mcslock_t *p_ml_perf; > > > @@ -53,7 +49,7 @@ static int > > > test_mcslock_per_core(__rte_unused void *arg) { > > > /* Per core me node. */ > > > - rte_mcslock_t ml_me =3D RTE_PER_LCORE(_ml_me); > > > + rte_mcslock_t ml_me; > > These variables are modified by other threads. IMO, it is better to kee= p > them global (and not on the stack). From that perspective, I think we sho= uld > be taking the address of the per lcore variable. For ex: > > rte_mcslock_t *ml_me =3D &RTE_PER_LCORE(_ml_me); >=20 > In my understanding, the only case where another thread modifies our loca= l > variable is when the other thread releases the lock we are waiting for. = I can't > see how it could cause an issue to have the locks in the stack. Am I miss= ing > something? Agree, it was just my personal preference. I am fine with the patch. >=20 > Thanks, > Olivier >=20 >=20 > > > > > > > > rte_mcslock_lock(&p_ml, &ml_me); > > > printf("MCS lock taken on core %u\n", rte_lcore_id()); @@ -77,7 > > > +73,7 @@ load_loop_fn(void *func_param) > > > const unsigned int lcore =3D rte_lcore_id(); > > > > > > /**< Per core me node. */ > > > - rte_mcslock_t ml_perf_me =3D RTE_PER_LCORE(_ml_perf_me); > > > + rte_mcslock_t ml_perf_me; > > > > > > /* wait synchro */ > > > while (rte_atomic32_read(&synchro) =3D=3D 0) @@ -151,8 +147,8 @@ > > > static int test_mcslock_try(__rte_unused void *arg) { > > > /**< Per core me node. */ > > > - rte_mcslock_t ml_me =3D RTE_PER_LCORE(_ml_me); > > > - rte_mcslock_t ml_try_me =3D RTE_PER_LCORE(_ml_try_me); > > > + rte_mcslock_t ml_me; > > > + rte_mcslock_t ml_try_me; > > > > > > /* Locked ml_try in the main lcore, so it should fail > > > * when trying to lock it in the worker lcore. > > > @@ -178,8 +174,8 @@ test_mcslock(void) > > > int i; > > > > > > /* Define per core me node. */ > > > - rte_mcslock_t ml_me =3D RTE_PER_LCORE(_ml_me); > > > - rte_mcslock_t ml_try_me =3D RTE_PER_LCORE(_ml_try_me); > > > + rte_mcslock_t ml_me; > > > + rte_mcslock_t ml_try_me; > > > > > > /* > > > * Test mcs lock & unlock on each core > > > -- > > > 2.25.1 > >