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 DEC1C43CA1 for ; Wed, 13 Mar 2024 17:17:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D347542E2F; Wed, 13 Mar 2024 17:17:25 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by mails.dpdk.org (Postfix) with ESMTP id 5D6AF406BC; Wed, 13 Mar 2024 17:17:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710346643; x=1741882643; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=KCUhk+ZHT7uAgkfoNC5F+iBJVejlb8uqZcfmaUtE7pI=; b=jwa02aBFnvxQj/jik0awvBQqZxiVk7D2U9GgMSkZ8k+uuimCbzsixG4M GaTqCSRzd0BvVOI59d/UKkP58ifqJ0mmhXveeZTkT1YU9TLtjVzFtu9jn jHwy1uFOHP/qDZzc5rRu6u1Fs2DPlHmRBUCkMayBBedR6Wg5wjz8jHmBy AcpLFJen73egpL9sffgXZcSXq9JkIZfyvUueXnlEx6nO55gXepCuzC9BZ DhCgEMu070jUbFIShVVmlNX1iQP25vwRukSJ0n2K6ZVjwwXGSCdaX+ADv hz6a2GcbQSQmIiAyyR7GMYxTkrS30ShPeqjl9zZijIe/CCyr05mJAxpp+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,11012"; a="4982935" X-IronPort-AV: E=Sophos;i="6.07,123,1708416000"; d="scan'208";a="4982935" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Mar 2024 09:17:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,123,1708416000"; d="scan'208";a="16651658" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orviesa004.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 13 Mar 2024 09:17:13 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 13 Mar 2024 09:17:12 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Wed, 13 Mar 2024 09:17:12 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 13 Mar 2024 09:17:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mfI0K+suVCSLLFVJJs6Dxm64GoKpHfsH1x7PfAqGt8ZHRYL8pqlsFLZHPh+MrETd1aizwlel1hoCE0yYUNSMl2tDspZdw6LlVnc6sFR+qtSA+Y/0qd+wL3dmN1WdmzAj7Ulriw9LeAQDJAJo/GRhY4XZXVIqBTr2jO+x+0eCzad3J4k2PnNlVQO0aM2Cb7amU6jYWuxCd3Xmj1L0hFuLpAzlLIB2Qb5R63MCJWA2m9PbayvRqNAYtdx62HG2ZljO/f5LRNqKBHUXAAzmKfHbyaAYeReJ2ds5kw1FezCyBItXY7YdRoiIzw+Yc3DblFkQlZroEf4Bt1fsTrchEuNBdQ== 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=/e8MtyIiKCIyXk3R3T1KAPlkf/dOUaGpMN2gfFkOfMY=; b=FePTiqeT8JnZ8BpoEh34LtJMxYfXkLJK49VL5KNH3FgOiE5Qp67O1HD85zD2ORCb2+uCFe5cBK7bgYSeU8XrddSyqWQKWTtfWOwcEV0EA0EBKfXfCvJoWyyniGj8ZQGPny5aVLb3fE9HoWvwQQLxLy3Yi8urRP1H5ZuzoXMCTKFQYI3ezYXvhWGX2vcPgtenPGzsLd9N2+1/4Bn/K5fvefdXgKsLeJ+6Q7dGCZQ8t22t7RrMI+D6Jwp+tdUqtfOBn87s83MpwARAPnqTQl5R1/EEiYd7UWGt6DLlP/uWtBkUPrUoLVsPt6VP34psu+SpbB6E5F4bIw213hA6frvy4Q== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by CO1PR11MB5028.namprd11.prod.outlook.com (2603:10b6:303:9a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.16; Wed, 13 Mar 2024 16:17:09 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::ab9d:3c81:51ea:7bb4]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::ab9d:3c81:51ea:7bb4%3]) with mapi id 15.20.7386.015; Wed, 13 Mar 2024 16:17:09 +0000 Message-ID: <2c593ca4-2e3c-4778-bc69-57e40af087d3@intel.com> Date: Wed, 13 Mar 2024 17:17:04 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/5] eal: fix memzone fbarray cleanup Content-Language: en-US To: Artemy Kovalyov , CC: Thomas Monjalon , References: <20231212042517.164353-2-artemyko@nvidia.com> <20240307070113.29580-1-artemyko@nvidia.com> <20240307070113.29580-6-artemyko@nvidia.com> From: "Burakov, Anatoly" In-Reply-To: <20240307070113.29580-6-artemyko@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DBBPR09CA0009.eurprd09.prod.outlook.com (2603:10a6:10:c0::21) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|CO1PR11MB5028:EE_ X-MS-Office365-Filtering-Correlation-Id: 58a5f661-cc83-485e-2fb8-08dc43790880 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MHe02E5ry35SclaRXgOFzJK+iUy/fXmfDvPN8zXaXRmh7Szbjj9wg4H2HglOOqBQMUWnKl/2vvi3MsjZkldpKnvP4poMVWVJD/nxUAaCJZ16yp9VBiG4M74Xrxt3kzhIOT8BXNiPrGxGagnBIzwfjixOXolK4FqkZOTWZeKh9aVfQOSfuGXZWXYt90a+iPDhietIPpWe4XBfcvT+NvTKLQc0mVnluLLhEaCd7g1SDre7cggHs1HAuSGmo54Y3r9U+x0FHpPCVyOmn03O+J79EYWagT7t9SFp4OnJ0TaVZEwjFSJO2LY1j+M+VGU+JJT783lCTh469LhpyOuqnrAEEpgbiUEGcQOQJ5QTwqPIaLUqnLKgjraqM6SUzj4ETj9rsQA/42oOb6cOzpQNJvvJJbwzPQVryeu+iQVG5L4xH91kjyVuTPl2cuH4PjNm9LVdJmQ+4SxYYVIBn+Ha/1bR9Dw0O4qdO9A+0eo/kIuSPy2HB8ft3BceXhpYbvyik1NyIW6gqWBgxtmA6jD9qcN/P4X/t4fyI+Pu7i6WZWPHY9zSZ8fTP/ay/zNubE22rzh2d7WxdjWYtll3VMjZAORi3tT3A/CGQpaevvBhy7/0mTM4x4Ex485y2R9GlU4aSqAUcS4yQntB78FQnyzmAPQJzwoMwk95PtO1xLNH/bRRwWM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NEFmNTFrSEhMQUJhaElCRVZuK1JzNjJDUWV0RG1hV3ZSRzF4VE1CckF6M3FP?= =?utf-8?B?b3JmZEVxaE9nYnZ2Q1hyeGlpQkp5dnNhRXJpZDl5K0p3V0lVT3FES01rcGh6?= =?utf-8?B?QVUzT2hMSUlDNjNrd1VsTXlycjNmT3ZEV2pURWduVk1UbURudWgwbVVzcE51?= =?utf-8?B?YW9Uc1lGMi9Ddmp2KzF0SDdYbEpBT0cySlFqSzhISElrdlBhTVpNMjNGaVJP?= =?utf-8?B?TXZhQnFqUFJnTVJMSXk0bnFNd2lSVElaZVM0NWNSSEJEMlIzTUJTdUIwZFJ0?= =?utf-8?B?RDJJSExyMUYxL3B3QTNqbEFReks2WkF1ZHlvOEpUdUQ5ZjN1Y3RZU081YUsx?= =?utf-8?B?bDBEK1YvaGNYTUVvb1ZlckVJS3FvZXo5WkQxNVp2TlRWVnE3QlJ3NmwrSm1N?= =?utf-8?B?M3psVmg3YXVKeWpxYm41SWZrSGUzWVpXaDBjUi9JYUR5S3VocUhZQyt2S1Ju?= =?utf-8?B?WERGUVZicldqM21BUjFCK2MzajBITG5pL3EvZ1JxR0RWaFJBSmFmYjNwY0NO?= =?utf-8?B?TEoxODdGcEErOEtjV2lzU2lhS0hLOSt0MW12eFUraXdaU05XSS9QOWNWa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ZjMXduUnI0S1U5?= =?utf-8?B?WVd1bktYK0xoSURCaGI0ektneVZmQTFmdEpuQVRDTS9EN29wSDJJNjlGTGYx?= =?utf-8?B?Nm9wdkVKRWJqa1JZUFZXSnY4eG1heGowZHQrc0t1MklmenZUOXV4VVlxekJ3?= =?utf-8?B?YXEwdTB6UUhEQk4za2hNWTBzVjY0ZTdSWVlKUS9xN1hROWNzRklJMkJsSXJr?= =?utf-8?B?ZXJXRURRcnJiQ2tYWk9iVWZ4cXFLdE82UW9zZTdla1FBWTBJOHcyZjN3OHY1?= =?utf-8?B?dEJ5QW42SEQvNVNXMnc4WHQwWllHZUd3UW1LNGx5WGNxTUZlcTFkRm5iZnNK?= =?utf-8?B?Nnl3eDZmeUp3UW5yM20xYndiSXdDajJtekVGcEZjOWlrYlcvVFR1bTNUbUJK?= =?utf-8?B?enF1OTBxZzhnUktOR0VscHlSeUR1QzIrMEZsTW1jWGJ2ZFI4ODRKS2dHNjlB?= =?utf-8?B?c09WN0lLWEc0WHFKclZRZ0VBNU9pT1RSR3RKc2dRd3F4Ymx4a3JjNGdJYnhl?= =?utf-8?B?N20vK2o2RUYra3lDczFvaGpDaHJmd281aUNqZzVxbkkwRlZLOThNblFvMytC?= =?utf-8?B?MjVueElFVUZNeUxJTTBRK2FYTUdoMWUzd2NGTjhLZFNQeVlKQStpSGFHT0NB?= =?utf-8?B?OVhYNDJoVEg0azliRklFYWVMdEUycklXbFR6M3M4ZGlQdXFzVlhKYlhMNG1U?= =?utf-8?B?RXc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 58a5f661-cc83-485e-2fb8-08dc43790880 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2024 16:17:09.3763 (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: MC8zalV6UnReNr1DrayaLqWVmhbLh+DrIpTu9GSNUwWCnMf/6LCAopvdSIrBeyTbOs/pYueQawq0MZv+T0F3lPbURyO7l6ex3WN2zp6YHas= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5028 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 3/7/2024 8:01 AM, Artemy Kovalyov wrote: > The initialization of the Memzone file-backed array ensures its > uniqueness by employing an exclusive lock. This is crucial because only > one primary process can exist per specific shm_id, which is further > protected by the exclusive EAL runtime configuration lock. > I think you meant to say "prefix", not "shm_id". > However, during the process closure, the exclusive lock on both the > fbarray and the configuration is not explicitly released. The > responsibility of releasing these locks is left to the generic quit > procedure. This can lead to a potential race condition when the > configuration is released before the fbarray. > > To address this, we propose explicitly closing the memzone fbarray. This > ensures proper order of operations during process closure and prevents > any potential race conditions arising from the mismatched lock release > timings. > > Fixes: af75078fece3 ("first public release") > Cc: stable@dpdk.org > > Signed-off-by: Artemy Kovalyov > --- I would suggest having a different Fixes: ID, because fbarrays were only added in 18.05 when we added dynamic memory support. I propose using this commit ID instead: 49df3db84883 ("memzone: replace memzone array with fbarray") This is the first commit where memzones used fbarrays. > +void > +rte_eal_memzone_cleanup(void) > +{ > + struct rte_mem_config *mcfg; > + > + mcfg = rte_eal_get_configuration()->mem_config; > + > + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { > + rte_fbarray_destroy(&mcfg->memzones); > + } Nitpick: extraneous brackets, this is a one liner so they're not needed. With changes above, Acked-by: Anatoly Burakov -- Thanks, Anatoly