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 793B445B5A; Thu, 17 Oct 2024 09:11:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 453FB40279; Thu, 17 Oct 2024 09:11:53 +0200 (CEST) Received: from mx0a-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 23B5940261 for ; Thu, 17 Oct 2024 09:11:50 +0200 (CEST) Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49H5LMHc003373; Thu, 17 Oct 2024 00:11:46 -0700 Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 42avbxr6xf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2024 00:11:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cNLyfdmPvpKUURr0rvp63BqiX7o5ymGAlX/tY+MOezBl2GWxFv8TTMbh6xXuBKfcS+z4BLa7peDu6s98t9Zs3YbVez/hPmgrkQt5oA0+E/JdvPLrp0MVTOGq5MgnEIDf+slgrmtCkUNLp0o26aBCmYU8MYCAJtXM7l5nZWbS5qgbpuarttrLiW0fi4k25gDaDiV06HNi97m5LLUsx3wlzq97GnbB5HTk0uBO/k8ZwUw2gw55cA6N13D8dN88JzFU1h4ZV6Xj8Y3Jc49QLmS5YeYP+BGsEwVPcN/bg7uK8f8U8nZPSLpyeEX2oqdcAk5tU5iiD/Tmqce2kywNMHSZng== 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=wcKgmxGYLHN7v2hVKZd+7YHi4+Wq0E3/E3pwxZ8oS3I=; b=BzfpQyxI4lalvoBhRrSRI9FCvcteHxXQ4rpG2XfF/NNIov0fghWSNO12D4/atOcQbcUhBJ4T1CS78bmijcakFzMFjnbR9QOhbWeeBdvIZDYOyrRhI5WZEh89ImqwXIC721/Q7MtYfzs+ip7yKxifGwZHwY5p1pab1UQlkIu445730w4nqIwL5sqSiAQqIVuvzzQwsnBAbCpuz8ZhoKRL0/7UNvOhopsBpPrREWeFuEipDRY2GEkufahkgBTKNc1OyhqnLLJ8L2x4iEDgumvswlzesNK1tI43lDTW41zPvvlX567QWg/b2qqTNOBt8JFs+75vR8oyFZo+y3Ek4/1T2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wcKgmxGYLHN7v2hVKZd+7YHi4+Wq0E3/E3pwxZ8oS3I=; b=tQoonR+rWwoV78llrHWj9YCsVcnRWKPoaAuyYytpP3ySa5Jkx68RACXCG6NLpouT5xHSUG8Ud52n+nrosNDRzTr/f6O6KZKzn7lswGfwtM2cVGwFAJCOQ8tUHg3idXSV2SHAF56hXG3ahpZDlMPDXGtilfVqegkl4dbYED9Ki44= Received: from DM4PR18MB4368.namprd18.prod.outlook.com (2603:10b6:5:39d::6) by MW5PR18MB5041.namprd18.prod.outlook.com (2603:10b6:303:1cf::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Thu, 17 Oct 2024 07:11:40 +0000 Received: from DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::1679:98:2091:7e98]) by DM4PR18MB4368.namprd18.prod.outlook.com ([fe80::1679:98:2091:7e98%7]) with mapi id 15.20.8069.019; Thu, 17 Oct 2024 07:11:40 +0000 From: Tomasz Duszynski To: Konstantin Ananyev , Thomas Monjalon CC: "Ruifeng.Wang@arm.com" , "bruce.richardson@intel.com" , "david.marchand@redhat.com" , "dev@dpdk.org" , Jerin Jacob , "konstantin.v.ananyev@yandex.ru" , "mattias.ronnblom@ericsson.com" , "mb@smartsharesystems.com" , "roretzla@linux.microsoft.com" , "zhoumin@loongson.cn" , "stephen@networkplumber.org" Subject: RE: [PATCH v14 1/4] lib: add generic support for reading PMU events Thread-Topic: [PATCH v14 1/4] lib: add generic support for reading PMU events Thread-Index: AQHbG8Lz18C3AnVickC0ZF6x2leNf7KBcZIAgASVqICAAxHqAIABb7hw Date: Thu, 17 Oct 2024 07:11:40 +0000 Message-ID: References: <20241009112308.2973903-1-tduszynski@marvell.com> <20241011094944.3586051-1-tduszynski@marvell.com> <20241011094944.3586051-2-tduszynski@marvell.com> <660c6a2a24fd4cd785333881208fb659@huawei.com> <083a1f7e27e94868b1917e92377b75a9@huawei.com> In-Reply-To: <083a1f7e27e94868b1917e92377b75a9@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR18MB4368:EE_|MW5PR18MB5041:EE_ x-ms-office365-filtering-correlation-id: 2f8fdbad-8029-49a1-5f72-08dcee7af2c7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|7416014|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?B?cUFmZW5xT0JkUlY1L0wxaUpvc3F0YW9tVmR5eENITDFRR3hFaFIrZ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:NLI; SFV:NSPM; H:DM4PR18MB4368.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(366016)(376014)(1800799024)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?QjEwbmo4REl6RG9rNU9lK2k0K2pKTGJXTDNjQUZiMEV4S0ZEdW9iTGllT1Vh?= =?utf-8?B?UXhGczhVNHpjM1RCa2liazRDbGtZVUlYVC9Uajh6RHprc1NOTkcvQWt4N0FV?= =?utf-8?B?U0lyYkh6SEJWa2ZMUU1FME41ZE1LR3lTMDRvYlVzcndHblRreFdKSlkwRU1R?= =?utf-8?B?MjJqRndKQU1lb2RpNGxtKzd1eVhiTHoxY2lSNWFRcWxtTFByNklhVUNpVkdt?= =?utf-8?B?b290cURRU0diNUNTVWxrYWN5OGx6aGhVaWxwWEZ3ZWVqYTNnZG9KQUpSUTZV?= =?utf-8?B?QVZDZHRnWEc5NXVDWHArK1A2ZkhZWndRY0tkQnlVSXNmeldkTFdwZmd3djNm?= =?utf-8?B?S3FlMWI2MW5GUCtHait0VURhM29Zd2laWTlKMVFpTWhpNGZuNEptSzd3L2Vu?= =?utf-8?B?T2NvOGlFWnJVTWcvNWIyY3hiWW93dVhTS3V1dXo1dXBER25nd2hBa0NpN3Rt?= =?utf-8?B?aVN1SkFtc0VZLzIvcE5xbEhSVWNHcnhBYVpIMjBIcE9ENzR0RWRsS0d4WnIz?= =?utf-8?B?OUxSRGxMczcvNzQ0OEhVTmh5VEdrZVlWYS80emdTY3hjVzRsa1M1WXhkZk54?= =?utf-8?B?eGJSVHg0SUhCYzlnSTBzayszNFhhR2xPdkJBM3BvRFIzRUVKbURTT3EyNjFG?= =?utf-8?B?UlFybkFCUTUzMWpTYjZRVlk0SkJTT3UzaGtIeTBMRzd3b2xCNm9Qc3F6cXMv?= =?utf-8?B?V24rYVVDZG85YVZ3SUN1UitJejBSdmFBMVhGdzZnVVd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UE9iMnYyOHhoSERRbG9HQmg1U0EzdDlNejhGd0F0?= =?utf-8?B?OEppSzVDWjMxdEtPbEhDNnRtbUl1SGVqVlNXVDdqSXlFRi9ZU21kWW9POE11?= =?utf-8?B?cjRvVkdDcDlCdlZoWWFwcStvdHdwTHlUQkVudUJWcDMzNGJ6ZGlSczlVVDJN?= =?utf-8?B?MHFWYzM1cWdRc2YxNFRMRkllVlJ5RTdyREVHcXB4YUM5ZmR5V09KQ2FVOFBu?= =?utf-8?B?ZGJYRnNleVhWK2lYUkQ2Zk8rdVVxcDZRTXRHL3hhN2doYk1wclpuRDU0NGZz?= =?utf-8?B?VWlrdE84OENWZE9YYmhFMDdQTVVNTnZrQU9zdE9INmtrVVZIWVVYSXlrRGRi?= =?utf-8?B?Mm80Z3JmT2hmalJOL21nYytrRWV0dHErQWpGdmRPT1FjTnEvUUtYQWdUSzcv?= =?utf-8?B?eGp6ZVhXTmVqcG95Y3hiQWV6TDV0azRVdDdKSDNMR3FjRE4zdS82UkVFTWxh?= =?utf-8?Q?gVtfcIAmMUQibTyV+VlkWoKAj?= MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR18MB4368.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f8fdbad-8029-49a1-5f72-08dcee7af2c7 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2024 07:11:40.5984 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: V6c4jU/pW8P2AFFqeY+AZzserSvQxHmqsDqzjaSvNsMx2pJiaGsJGEBU3GUGFQu10an+xOULLZ5N3jd0JbnEHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR18MB5041 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: oHV2bEqVbwJ5_GWG9l7LhUCpoOvIRd82 X-Proofpoint-ORIG-GUID: oHV2bEqVbwJ5_GWG9l7LhUCpoOvIRd82 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 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 >-----Original Message----- >From: Konstantin Ananyev >Sent: Wednesday, October 16, 2024 10:50 AM >To: Tomasz Duszynski ; Thomas Monjalon >Cc: Ruifeng.Wang@arm.com; bruce.richardson@intel.com; david.marchand@redha= t.com; dev@dpdk.org; >Jerin Jacob ; konstantin.v.ananyev@yandex.ru; mattias.= ronnblom@ericsson.com; >mb@smartsharesystems.com; roretzla@linux.microsoft.com; zhoumin@loongson.c= n; >stephen@networkplumber.org >Subject: [EXTERNAL] RE: [PATCH v14 1/4] lib: add generic support for readi= ng PMU events > >> >> +int > >> +__rte_pmu_enable_group(void) > >> +{ > >> + struct >> >> +rte_pmu_event_group *group =3D &RTE_PER_LCORE(_event_group); > >> + >> >> +int ret; > >> + > >> + if (rte_pmu.=E2=80=8Anum_group_events > > > >> >> +int >> >> +__rte_pmu_enable_group(void) >> >> +{ >> >> + struct rte_pmu_event_group *group =3D &RTE_PER_LCORE(_event_group); >> >> + int ret; >> >> + >> >> + if (rte_pmu.num_group_events =3D=3D 0) >> >> + return -ENODEV; >> >> + >> >> + ret =3D open_events(group); >> >> + if (ret) >> >> + goto out; >> >> + >> >> + ret =3D mmap_events(group); >> >> + if (ret) >> >> + goto out; >> >> + >> >> + if (ioctl(group->fds[0], PERF_EVENT_IOC_RESET, PERF_IOC_FLAG_GROUP)= =3D=3D -1) { >> >> + ret =3D -errno; >> >> + goto out; >> >> + } >> >> + >> >> + if (ioctl(group->fds[0], PERF_EVENT_IOC_ENABLE, PERF_IOC_FLAG_GROUP= ) =3D=3D -1) { >> >> + ret =3D -errno; >> >> + goto out; >> >> + } >> >> + >> >> + rte_spinlock_lock(&rte_pmu.lock); >> >> + TAILQ_INSERT_TAIL(&rte_pmu.event_group_list, group, next); >> >> + rte_spinlock_unlock(&rte_pmu.lock); >> > >> >I thought that after previous round of reviews, we got a consensus >> >that it is a bad idea to insert pointer of TLS variable into the global= list: >> >https://urldefense.proofpoint.com/v2/url?u=3Dhttps- >> > >> >3A__patchwork.dpdk.org_project_dpdk_patch_20230216175502.3164820-2D2- >> 2Dtduszynski- >> >40marvell.com_&d=3DDwIFAg&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DPZNXgrbjdlXxVE= EGYk >> >xIxRndyEUwWU_ad5ce22YI6Is&m=3DoJ >> >- >> >eSnmJoK0r1zVFhKrkWMnfelOkxqpjtX2fCrXaG2RdWagOqAQ7vcFCJ0dOWrTt&s=3DTvGxq >> >QmUz_U3xLOroMxOmsCiaxdqbNLi6GZ >> >pHIefniw&e=3D >> >> I don't think there was any consensus. It was rather your point of view = solely. > >Here is a mail where I highlighted the problem: >https://urldefense.proofpoint.com/v2/url?u=3Dhttps- >3A__inbox.dpdk.org_dev_6bf789b7ba4e4a8e847431a130372a4b- >40huawei.com_&d=3DDwIGaQ&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DPZNXgrbjdlXxVEEGYk= xIxRndyEUwWU_ad5ce22YI6Is&m=3DwN1 >qnauDKLK8D51b9VKif_iUKl3vHRCvB4El-B965rNZHUr9xDs6GiBAERI6lHSM&s=3DJ0zulN5O= mv_77822arGCtQhab6oa74zF- >tBWcdU7ZUI&e=3D > >Here is a mail where Morten agreed that it needs to be addressed: >https://urldefense.proofpoint.com/v2/url?u=3Dhttps- >3A__inbox.dpdk.org_dev_98CBD80474FA8B44BF855DF32C47DC35D87792- >40smartserver.smartshare.dk_&d=3DDwIGaQ&c=3DnKjWec2b6R0mOyPaz7xtfQ&r=3DPZN= XgrbjdlXxVEEGYkxIxRndyEUwWU_ad5 >ce22YI6Is&m=3DwN1qnauDKLK8D51b9VKif_iUKl3vHRCvB4El- >B965rNZHUr9xDs6GiBAERI6lHSM&s=3DaUb6eYuLukWkofeLkMzDbBiafIeQXlKbxnw1OTauaM= U&e=3D > >Here is a mail from David, where he summarizes the remaining work required= for these series: >https://urldefense.proofpoint.com/v2/url?u=3Dhttps- >3A__inbox.dpdk.org_dev_DM4PR18MB43684B889C50F20DDD1B0A29D20CA- >40DM4PR18MB4368.namprd18.prod.outlook.com_&d=3DDwIGaQ&c=3DnKjWec2b6R0mOyPa= z7xtfQ&r=3DPZNXgrbjdlXxVEEGYkxI >xRndyEUwWU_ad5ce22YI6Is&m=3DwN1qnauDKLK8D51b9VKif_iUKl3vHRCvB4El- >B965rNZHUr9xDs6GiBAERI6lHSM&s=3Ds8o4dWZJPBqtPTYSYB1jT7ufGGu-ADncO6u0ZRgOAu= Q&e=3D >"... >- Konstantin asked for better explanations in the implementation. >- He also pointed out at using this feature with non EAL lcores. >..." > >Here is your reply: >https://urldefense.proofpoint.com/v2/url?u=3Dhttps- >3A__inbox.dpdk.org_dev_DM4PR18MB43684B889C50F20DDD1B0A29D20CA- >40DM4PR18MB4368.namprd18.prod.outlook.com_&d=3DDwIGaQ&c=3DnKjWec2b6R0mOyPa= z7xtfQ&r=3DPZNXgrbjdlXxVEEGYkxI >xRndyEUwWU_ad5ce22YI6Is&m=3DwN1qnauDKLK8D51b9VKif_iUKl3vHRCvB4El- >B965rNZHUr9xDs6GiBAERI6lHSM&s=3Ds8o4dWZJPBqtPTYSYB1jT7ufGGu-ADncO6u0ZRgOAu= Q&e=3D > >You didn't object, so I interpreted that (probably wrongly) that we had a= consensus here. > >> So I still believe >> that given currently that only runs on lcores and lcores do not >> terminate before the main one hence it's safe to access TLS from a main. > >Could you clarify what you means by 'lcores' here? >Threads with valid 'lcore_id'? >There is an API within DPDK that allows user to assign vacant lcore_id ((r= te_thread_register) to >some new thread, run it for some time, then release lcore_id (rte_thread_u= nregister) and then >terminate the thread. > >Another thing - there is no checks within PMU API around does this thread= satisfy expected >criteria's or not. >So if user will call PMU API from 'wrong' thread - it would succeed and fo= r many cases will keep >working as expected. But for other cases (thread lifetime is shorter then = program lifetime) it >might cause a crash or silent memory corruption. > There are plenty of ways user can shoot shot show own foot and the more che= cks gets added to APIs, especially the one that reads event, the more cycle= hungry it gets. So there needs to be some trade-off.=20 Currently I'm not aiming at supporting everything, rather worker lcores whi= ch are spawned during eal init and say till the end.=20 As said once basic version gets merged I'll continue work on improving othe= r areas.=20 >> Once support for running on anything other than lcore gets added current= mechanics is likely to >change. > >Honestly, using TLS variables within the global list here - is just asking= for trouble. >Please fix it, there are plenty of simple ways to avoid such issue once an= d for all. >Without this problem addressed, my vote for that patch is NACK. > Good then. I'll address it earlier than anticipated then.=20 >> And as you pointed out, there are plenty of options available. >> >> >As I said before - I believe it is error prone, and needs to be address= ed. >> >There are plenty of other ways to have one object per lcore (if that's = really necessary): >> >array of RTE_MAX_LCORE indexed by lcore_id, or new rte_lcore_var.h >> >API introduced by Mattias recently, or even simple TLS pointer with mal= loc() behind would be >better.