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 0D60246068; Mon, 13 Jan 2025 06:13:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5FCB40653; Mon, 13 Jan 2025 06:13:03 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2075.outbound.protection.outlook.com [40.107.21.75]) by mails.dpdk.org (Postfix) with ESMTP id 02EC2402EA for ; Mon, 13 Jan 2025 06:13:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q5dy6N8oCl940Oj838ehxaQD38az89J0EvKdNGygGTurg0XHa5YqQEOI4milLCsaiqQ4G6HrD0T6pWDBTG8MDirlvfvqXgtCVJP80O5D5HjKcYjZsUijrQhxk2iqx2erNTSWm4yixSAQtGOwZo2brCcZUFv8mGAQfHf9GgyX4IzQ05vSUYq357r7y+U3/V8h0RIQQBSHtcZkZBA8QI1pPGfFzhFVvsI2jmcgE4DIb8AlsU7aa35unpvJrRze2zEmYneeP3AmMqn/pG6BkTFpK0EBLjJM1VaVMevQ0qvQqXWOwDi9OnMEgKepvInkNQsilzBgUFoXIXHtQsXifsDoDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JhrxaMCpPAlvKSU1Wjv+WMPM9utPDr8Fy/p1baYOeBg=; b=c2dkYxa6X0P9FuJFo7XP4mkE607YE46kvtQhGzwXjSL9pa7oHybBS6BhgHRPo/HMwzQCyb3jDttIp8ba8eS00lhI5QAVjWx1wYqJ8MGaGS8sKzm/A68LcflZ8sLh2VF6/85PH1rFNgq0882dBveV4Opa6E95LTy/uRiLERPg0WKIY7IPmSEB7X79Tv2sRtYQIlCyC0WB3qV/rZTahQyfshW8yJKPmBo7C56UJS0Ui80mOLn3yRtwJVaeUzPVskkOnIW6cGIopjY3QnlNZAdQap2MrqX48fM0f+xIbqSD2NS0SXcUOAHwza8jszU53T2Z+aMNtgzRKnWmDD86q5MjtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JhrxaMCpPAlvKSU1Wjv+WMPM9utPDr8Fy/p1baYOeBg=; b=XHLigfVey//5c0ruqL1R60oVsaPM7cLYcRYFfRsMw2SnpbL+Usdvwm5WonWXzLprwANwuIqTLnJPzKFv7w1dFsEqwFptAHZJEBgK9mQhIlMsOHUX63FsQfULSUPBtSbyn9AJgbEMmDAxnWBCDEZPQq7c+2bdytreR5EY4UyxOJfd2qjKUhjKUf017IXdWg5EhIwt2Dny9J6k76iG4TaKi57TniVYSxiSrWOXUlMqXgTM7nH1vVPBlLGvS3IsTOpzLb4qWCAEYilGHlv/BHdwXd70G/DXSBOGQpBZCufUt0EN6bYMssuSl/a+ioPHnsEZPktpqO5jbE5Gdj1sCMi0Sw== Received: from AS8PR04MB8198.eurprd04.prod.outlook.com (2603:10a6:20b:3b0::14) by PA4PR04MB9685.eurprd04.prod.outlook.com (2603:10a6:102:26e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.15; Mon, 13 Jan 2025 05:13:01 +0000 Received: from AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195]) by AS8PR04MB8198.eurprd04.prod.outlook.com ([fe80::2e32:1a4a:7d29:195%4]) with mapi id 15.20.8335.017; Mon, 13 Jan 2025 05:13:01 +0000 From: Gagandeep Singh To: Stephen Hemminger CC: "dev@dpdk.org" Subject: RE: [PATCH] eal: add worker threads cleanup in rte_eal_cleanup() Thread-Topic: [PATCH] eal: add worker threads cleanup in rte_eal_cleanup() Thread-Index: AQHbYyuGeo4NaUT+AUqv8ZZ7QOBMT7MQQSUAgAPk3lA= Date: Mon, 13 Jan 2025 05:13:01 +0000 Message-ID: References: <20250110064717.1372216-1-g.singh@nxp.com> <20250110091902.5139f8b2@hermes.local> In-Reply-To: <20250110091902.5139f8b2@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AS8PR04MB8198:EE_|PA4PR04MB9685:EE_ x-ms-office365-filtering-correlation-id: 0916d824-f06b-48ad-4912-08dd3390f3d9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?443wJh5g2yCtPMKLdTWPYKpBAfxTsyrrfOOq8FG3Jf3cR//WUKdCDJqdyokK?= =?us-ascii?Q?6TcxYAa+YOGib553KljvlxVcoT5UJsLB1awTkd7KpTXfQsP2q5kR5n7Z3t9I?= =?us-ascii?Q?7dB3r04O3FNCsUCpMcUZ++/tIuOkbcgafmGJ5nY2SnEGgh52BXnfNvo0LkWG?= =?us-ascii?Q?gb7VrfYogPWlQXI+SVtCFxHnZeWIHTXNwtvwQ1U60LctglMeG31ph+pxylvh?= =?us-ascii?Q?IV9qrw7r0E+5UbGjSvFRWgfEqnXK+oNmvuEFg+550+53JZrdwsWOrJK0wKWK?= =?us-ascii?Q?/FSQwUKpw0P0tgKM1ds4RtAntpj1QYhEoy2dT77ULVy/M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5ldyCnnUcFTJEmvp/2rkRxRn228402Vg3e0Mfza7Ltfi?= =?us-ascii?Q?teppdwnme7y9ZXU/B2/L3FIO7YOc4CTVnhs/Q0QPK+ysNwGpiKVJdHUFj5I/?= =?us-ascii?Q?GugT3mtWUMaqjhasEis22b17kGJA1537oK1p1pYyvvk7YwMoSUOhlkZm+2Ne?= =?us-ascii?Q?gSY2pYKFwMYBhqUq1LQKMRc8IwtiDgi8h7Ehu/yIApk1J4z3k+WXO4Rv2IpX?= =?us-ascii?Q?r9xmajaYljc8FSIdH7RtybEJrQeh71jI?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8198.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?vU3NWGBZA99Z16j0WWHDqJALOvOdpP/1pb9Z2Z6mMVgXD3JsmqUhBXH9Iqok?= =?us-ascii?Q?lFU81InsdRwNvkBerUVCbvyQOvVveFspp5PZtJsVzznJM/YXv1O07erPKlYa?= =?us-ascii?Q?d4o8LE5EyTbs9hy8cQpdL+fP8fBQd/eQM1/EOugtyLtZcbHgHKKlq//UwU9C?= =?us-ascii?Q?Zf+IvplhZ+ifHgEceiIiYydH+b3mpA+QmwNBbxJ5Q7jpue4dEf0AUFxtfCdS?= =?us-ascii?Q?0nVqbQjk4axrTl6RRKvBDNYiNIN4hdaxYek2h0SFnTJzB9mNnFWpg3I30OHe?= =?us-ascii?Q?c0LsH0lXUvcDs3ZpwtiAqRF0fUHOCmRajHNfxhmcU32h4CURTuL0nmUY6UEB?= =?us-ascii?Q?UhSz87flb3GbRKoGe2zgvbbMi5DPD3FBOEH3pvadolYY/Wsiqf0Kx1Pdt4Nk?= =?us-ascii?Q?C/kvmn9fh9d0HACFVDlow/ULD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1L?= =?us-ascii?Q?v/itg0dyupL6qH7xKQqnazE+7CSvCJZq3VEy4LQQGpBvb+GndjseE/6djzx+?= =?us-ascii?Q?9jLxX5Xd/YBS2Y7tT5F4dTBXwj0ctNBvACDyfLb6U613PqBu5lwmk3PW6j8o?= =?us-ascii?Q?/+0ucK5GdK3PM3KZi+nM9jz5UOociDeVFyUsPcQ4Qr46KaglbV2VppR08RUy?= =?us-ascii?Q?FNW0mYMjGpt5jKM+ne/xKNJykAZXcn2NTF0/Iyg5zYGM8LsOgX1L5ogvzsWM?= =?us-ascii?Q?nFHtmSzhoyjOHRY+01M=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8198.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0916d824-f06b-48ad-4912-08dd3390f3d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2025 05:13:01.5421 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 60Npk1bP2GFuRWeqey5w9GqvYs4V9M6F19UstiJ+t3/m524lwT3T3lpGU5gCD+xr X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9685 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 Hi, > -----Original Message----- > From: Stephen Hemminger > Sent: Friday, January 10, 2025 10:49 PM > To: Gagandeep Singh > Cc: dev@dpdk.org > Subject: Re: [PATCH] eal: add worker threads cleanup in rte_eal_cleanup() >=20 > On Fri, 10 Jan 2025 12:17:17 +0530 > Gagandeep Singh wrote: >=20 > > This patch introduces a worker thread cleanup function in the EAL > > library, ensuring proper termination of created pthreads and > > invocation of registered pthread destructors. > > This guarantees the correct cleanup of thread-specific resources, used > > by drivers or applications. > > > > Signed-off-by: Gagandeep Singh > > --- >=20 > What problem is this trying to solve? >=20 > Canceling threads sends signals and can be problematic. > Many of the operations done in drivers are not signal safe. To ensure the proper cleanup of thread-specific resources, the DPAA driver = initializes pthread-specific destructors using pthread_key_create(). These = destructors are executed only when a thread terminates or the key is delete= d. However, since threads are not terminated when the application is killed= , these destructors are not executed, resulting in resource leaks. To address this issue, we propose adding thread termination code to rte_eal= _cleanup() to ensure that threads are properly terminated, thereby triggeri= ng the execution of pthread-specific destructors Any alternate suggestion in case pthread_cancel is not a better solution? W= e can add pthread join timeout to avoid blocking on thread stuck or May be any way to call pthread_exit?