From patchwork Wed Oct 16 10:20:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13838130 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A49B4D1AD41 for ; Wed, 16 Oct 2024 10:20:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3CBC36B0083; Wed, 16 Oct 2024 06:20:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3546B6B0088; Wed, 16 Oct 2024 06:20:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 17FCD6B0089; Wed, 16 Oct 2024 06:20:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id E522A6B0083 for ; Wed, 16 Oct 2024 06:20:58 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id F01871A1ABD for ; Wed, 16 Oct 2024 10:20:40 +0000 (UTC) X-FDA: 82679071692.17.7C6B331 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 39F0810000A for ; Wed, 16 Oct 2024 10:20:39 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=QnwsVeHD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=T6gLNDuw; spf=pass (imf05.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729074007; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=leaylDcupTOZI9b+oNGbuEFvgzqLFfPeGFEA0raKqb8=; b=AK8b7ZN19kENzkycrjpJRMOvkYhMJVXySy7dzNXjJDIw/liS3UUNT1Q+Wei5jykx+nn3hP 7uZthh8wq4UGL2TKH+psVtIguNWDgwB8xxPQtfN2sAuU5qYqi1yhKI5hKvk5h1AfN+NQyV mbrLGjVRBXIF8NOI+kKIZo36EZiIAqM= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=QnwsVeHD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=T6gLNDuw; spf=pass (imf05.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1729074007; a=rsa-sha256; cv=pass; b=WwwjDnNj5cVEY2pMQ+T315bRAHDTPNcv4iuJQl67xjoRSXonRCmJwCoawvx282Han/bJtj 0RIbaBqxrVoe4mc2zxFgvPi9oJe1OORXBL5E6Pi0IDSng61DBOnFqUUEpZICD9LIO8hf3r 4VCRX3o1fSzikl+XUZOQmo0tAAYkreM= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49G9tgqQ022173; Wed, 16 Oct 2024 10:20:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2023-11-20; bh=leaylDcupTOZI9b+ oNGbuEFvgzqLFfPeGFEA0raKqb8=; b=QnwsVeHDcBANv0Ra/c26k1nfmTOq/SX6 Zn6QQ60L4bOGq8MAlyPOj+rGzWe2mnwd0vFJ1C31niOW/t1J37bvrA9pRuSwd9TX Cy+S3Xh7Vc0DdIhctuvHuogLXuDujnM3VSWpiCukk5vKBd3Kd+Y3ZWTTh+y9Q22P VBYmUZVHqQRtbzxiVT7HH4eu24ahaj+HCd0c7HhafS/69AGHypYtSLJY7vckSD5D YfsCDldqWWzO9RDvJgaP5DCcJnHdB0vFKHWVX1GzqORRsI4ApLxxxXyniBtvIIgK Cw3QqiQ4I7R/MI8Z8MmGhCbUcD+0jcPQnP8f1HsEVzNbAdusjSmX4g== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 427fhcjyud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Oct 2024 10:20:48 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49G8sFmU011048; Wed, 16 Oct 2024 10:20:48 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2041.outbound.protection.outlook.com [104.47.56.41]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 427fjexxb5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 16 Oct 2024 10:20:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=C2bbu8ny67QQ91Qi8gwt78XmiGS4zdTsPLeIKBAi/6vYEQq4wQpFk+F8JPxHmsPBDKIXUUM0mzerP4zWHya8J4C3F/O5feX/g17wLEThplM7OkGLkUvhQZGJR7N7O8iiVH27hi7Qn4BXgpjUrUN0rcUGsQv9Dg/sIwuHX8iCJCLa2Jv7nxi4WEo5rkD1GDPsUa9YdSNFt9MOGKcJw5Oh6y7WhM7nIEtnlv205wOtPasE0qZaVm9hQ3jpOQ7yZrTLpofnhtjf3RgYdVdpwnKs2O1Ipo7cKO1uvt1h0z/ooJ71Mi8t++NpotNfjfr2iCpd2us92K5yN/JZSraCZYpo1w== 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=leaylDcupTOZI9b+oNGbuEFvgzqLFfPeGFEA0raKqb8=; b=xJFUVFOvO6ac+ZbxLWhbQh4C32Vcz0ZgaAQIK8ZLwAkXW1Q1XTysm4a/taHaI1DOZgl0LOYkhX1FtEKJfYKiTYzEVSA5Pj9Qta6WAHDGk4K1GGBxNGZ1vP9SiDzhaU5ohsR35xWVZzk0qHkPC80Zb4HW4KzUDt/THHOFrAawbWs8BkQ/NoxCprtgfnY3d229R/o8AW0t0ikkzwrKrvdh8LHnAOK+ejEP9KEHju56I4nRs92SMV9Mb+yeLQYZGiTmj7EVZGr9bilOWocaKvSDejV4kCS3AnSXRKgnwHl8vgEUXwioNTHQxcXdNFb1lBT40kojfK6zgmQ6UlysstNalQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=leaylDcupTOZI9b+oNGbuEFvgzqLFfPeGFEA0raKqb8=; b=T6gLNDuwvu2EAU7h2rev/XV1vhHs6c8zSTX/phRNc3QyUTkbLKv9ML7ScPo1w7U4XF7vdFR44grIatJIbflOuZQlCR/zeKKCXuuHEVQEd6xlIu54Qb6nRbhxKAS12pMfXA0knnihEwKSnheQA1R3o2z/IHmD2Ad5B9cW7IsFEZ4= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by IA1PR10MB6172.namprd10.prod.outlook.com (2603:10b6:208:3a4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17; Wed, 16 Oct 2024 10:20:45 +0000 Received: from SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e]) by SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e%5]) with mapi id 15.20.8069.016; Wed, 16 Oct 2024 10:20:44 +0000 From: Lorenzo Stoakes To: Christian Brauner Cc: Shuah Khan , "Liam R . Howlett" , Suren Baghdasaryan , Vlastimil Babka , pedro.falcato@gmail.com, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Sang Subject: [PATCH v3 0/3] introduce PIDFD_SELF* sentinels Date: Wed, 16 Oct 2024 11:20:36 +0100 Message-ID: X-Mailer: git-send-email 2.46.2 X-ClientProxiedBy: LO2P265CA0483.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::8) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|IA1PR10MB6172:EE_ X-MS-Office365-Filtering-Correlation-Id: 220da6e1-bba9-4e07-68f3-08dcedcc3173 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|366016|10070799003|1800799024; X-Microsoft-Antispam-Message-Info: hmYkoa+onQCPnDR0j3oy29sJQU1LsjE61tC1EHV/Re4kIG7jd2tsy1e+75GO05rCjcwS/NKcldwhyq9NVygJrlCtjgiiWGUsp8L22NYj6A+2bR3c91qzG1ZAY7uYcto+zCp8JDuy3G5zzFFLspaJJSsI/FHWu8Y4smDx8Dol2Y4l+x+tXNBIqqbua4Tahauv3il6dgscUS5b+A+gdkKBzEpmBc0NqWErX+J5TREwu4J5qIreP/UUgJLYuK4Q4l0Ekobm5OQiLz6vsbwOXZGo/JNOtssUK5xnxtVPrFrNECNEJKNNXGGWvZcp4neMc9d4TI4IeSDHnB3mO7mAkhZx58erX/drBwIYx11yk1wfFvM+2QZ03iHZAKLrRyjBodk1SxQ6VkrqblVfw7R4Nd7bCGOORCR4FANKMlqL9WbhsgBa07szSs5M+JcWfNsyuanh3wElwYO4Hwl72IH/2ZR1SBZ5+YRWh/aUzoxTw+x9bKEofET1m5GhdcTkq9TUF3YveFg/VZJLJ/VY5DAn086e6BZiWx8rnmPFTUcFja/ohgYSP5Ae9TbfpF9/gvXTjQgxGy4PEdhHgPl45DR70l8AtifpFPNKR28Yo+2wDvjkdF0QNS/jQG5+o3pnWu9fYCydLTdLS0fBkXFqmWhelxzxujZQcSb9jwGFuo5u1t6wi6oTsvZF59O/q/2zN5CJ5w6L2QdzwOZcUrAVXw3I/aNoHa7jc4WE39lRwR0aOv8hw+Ljbq/rFaisLLyNsWN3ctnv8sn3QxqR+vbLGyHz/5t99/fl05uA2KL5iKiVT2qTk/gNOfEoDvI47RHufimDLKxpM3x1kgrjtAC6BXzz/c9lFR1bq03LSD47qoS/jaWZGhftZGJBcG2LEtNGdPoSBvlTYq2R07MKct24CUIOMtu8m8Ia7M/JHxTqQ32Im3eq3AZsWLwF64NPT5ZQZN5Xoh0Mvkhz04kzxnoyHaW+q0YNLOdDhiXo3dofxrAf+h91m4fDxCxKfC6V7VAexY311DT55CRN79dUWqFS30s7xpJgG5yvVxFtjFtFNpBK4UWMpd95k38kulwdq5mffxkU4OLmhyoDK4jn17dzhzLGJUuneKjIKumewKszc7nvyA9gVkUqdo63fmK1aFUQ6BE0VyjJAcnyJrLx/s25SpmDzb4mxXx2xAVayFezV9RaSQq5kgb/p2zBKwNyxrI0hdKuNNayhE/YtHu1IxqIZUZp+FaXUBm6/PQf4+JOEZCfKELznqidQbU5Nh/F41C4sv4J9VvQjD13+sIkc2Q4EIfic5Mj4yl2Rwh7zBLMdqKu4344TbA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5613.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(10070799003)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UI/FRr1EvIfK2hoFdz1ePtxCWqJsyz7AZCHWT0dtV5+Jbod3ylT8DZyWizqL7D44Z2tC5XlO79EgJNOXdWwHoGpNlzG4cDVAMyRs2NVzXuUvk4N7CG0e8EeJe1TiXHs+8GomxeCtfVZzo4EaDDfjuBD+5anS3iIkroWZnapsv3vsV83HZOOZJqaS898sDEc6+QlLh/TMjbh7oBWWBkh/fheQ9fJmXwyhhVfwQK+23ghjx1YkAh+YR/2aeN6wDAippgKqCMBs69LBssQaFIqAQSESVmrlM29Uk4ztQXUw2U1zN0ZZh1ZbuXlhht0kQ1Ez+NxATEjh7461OVtNUtmJX72Ou/TlTjXJAX4nS+YYbJxnhK9W1AU3zNL0ReR78Alr/uK1ybkIAHS7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G0IEl+e9p6SWYioOniByPPBDRUl1nO8K6wBpijA6Z10v5SA7TI4J7Te+kYyyvsc59oMWBaM4nQTi/kSJqeuUQDD0JxrdA/ZPDfcfI1l2fJ/aDuTxhdgFB7Qioq33mt6flES2m1TxjemisKMGnPGQVWpNmiaITi6wzI0EANgW2GfVBkgsscndpLo0Z4bsQUEE9dRLEPr3Q== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: hbaA3yGoLgyg2uEhipMgUVaj8QGw7TVtiPhuBBbA5uLwg37jnPk8YakwMEATG6u2JPJstL1Ah1eD/n9ygMpn6DSbqPhl80D/tyoP3z/MAzs/fHHh7SigHk2Vy+3E/Wddp7hvtwWGEZOpzp6TioDTEWlsgOH4L/Jmndml20Y1xp+wQ4dm5pAo88Tu47Q1gZr+h/oSeSiYBSm86v9nFZCmfIXwp3fEsXdrW5uouT/7qfimbV6lmLcLDnSdLS1tPQUzOG8h3XauHcUzaKvJ2Dodi38dFUbD93Oh4k3pg/QWPdiS8rI7EhTwsIBt3Bvt4TbhEtzJse3nQZGtcVjyI1keeMl5pHc+DGP9A5tDxWYwLqpYij+LTqPmkpXeeOMJgxvTACWd9p6fBMgDR7l/g+E5y5btjKAMh3kXNAAHD7HIwnW9UcAgL/atVsYLuqUckN9WdDtdyvcfD8e71Gv4yCvl/u6c2v+visQRke/h8q1kdIgtrAsZ6oqYDNODCcrMMlkMQ67PECQKYlMBFahRCplgK2cHldRQWcIwNgooU8Tu2hS0eaeDviC99hOKFRhf8bQtVzmo7JXjYqDnsxpJDnSvSWd3HBRZG1RSttTgKk1JFsU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 220da6e1-bba9-4e07-68f3-08dcedcc3173 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2024 10:20:43.9500 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uAHOmQnuUpJgjpuW6l0Do7wHauj/KuqIaL0cADjZHU37lR5m/g5dLG1J01LpdrP+4AsKoFV7Kh8LwnV4tK17RF9Gkjw+jrk00MZ6v0/gjYw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB6172 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-16_08,2024-10-15_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 adultscore=0 spamscore=0 mlxscore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410160064 X-Proofpoint-GUID: bsVEN6zScKpUXQGksAeUvpgR5VChdQIJ X-Proofpoint-ORIG-GUID: bsVEN6zScKpUXQGksAeUvpgR5VChdQIJ X-Rspam-User: X-Stat-Signature: r59qkxtjk99eir8jsac77p159898wdjm X-Rspamd-Queue-Id: 39F0810000A X-Rspamd-Server: rspam11 X-HE-Tag: 1729074039-472255 X-HE-Meta: U2FsdGVkX185tVURwhIVtU8zmJXnmb3V+K+6/GusVrCzEEuSch5mS9DO3vO/jCbW/WXEOtnWuVzAzcWiyLOg9WPVwLKlU/Kv7WgzgMFZbrv/SH/lS5HYu6b6ZS06N+RUKc+1k3S8cesBwYpY899d5xrAw+O0JvQ62TZ4WsCZx2lYi4sTyFZmxSyD3t2wYW4Dc9kxl2qAtFuk1I0d3o8u0FTXQIX3xxq3u5zHHlk8IngMjWiX8YoASf9EnWwJ348y3jG219pjdKUQiK3QnayhbWVMEkrC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UT/H1tU475fVUt7ORs5gitFBtXnRFOFTbZHgv6YZolEYi6wSbbFdQH150tZfOo4+CZcm7KNJ5HV0NT6oloUErpPK95TusXSXhigYpTmSIOsfl5M+lLvirqmZq80eb4lduWZ415HKSRmUM9fK01KEsZ/N430Vyug1lAWKOPkVgzQ7HDhxmFMyM/TvMpRBARSafHB4EZX2c519NUbkbmC59676IBPGrv0a1CoNubGmYX/we7KnoVs7dXiSiBSfblv7jIWQxC+IXiO50CvZ7YvzM4NQ1BGfe0Nz+ANss X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: If you wish to utilise a pidfd interface to refer to the current process or thread it is rather cumbersome, requiring something like: int pidfd = pidfd_open(getpid(), 0 or PIDFD_THREAD); ... close(pidfd); Or the equivalent call opening /proc/self. It is more convenient to use a sentinel value to indicate to an interface that accepts a pidfd that we simply wish to refer to the current process thread. This series introduces sentinels for this purposes which can be passed as the pidfd in this instance rather than having to establish a dummy fd for this purpose. It is useful to refer to both the current thread from the userland's perspective for which we use PIDFD_SELF, and the current process from the userland's perspective, for which we use PIDFD_SELF_PROCESS. There is unfortunately some confusion between the kernel and userland as to what constitutes a process - a thread from the userland perspective is a process in userland, and a userland process is a thread group (more specifically the thread group leader from the kernel perspective). We therefore alias things thusly: * PIDFD_SELF_THREAD aliased by PIDFD_SELF - use PIDTYPE_PID. * PIDFD_SELF_THREAD_GROUP alised by PIDFD_SELF_PROCESS - use PIDTYPE_TGID. In all of the kernel code we refer to PIDFD_SELF_THREAD and PIDFD_SELF_THREAD_GROUP. However we expect users to use PIDFD_SELF and PIDFD_SELF_PROCESS. This matters for cases where, for instance, a user unshare()'s FDs or does thread-specific signal handling and where the user would be hugely confused if the FDs referenced or signal processed referred to the thread group leader rather than the individual thread. We ensure that pidfd_send_signal() and pidfd_getfd() work correctly, and assert as much in selftests. All other interfaces except setns() will work implicitly with this new interface, however it doesn't make sense to test waitid(P_PIDFD, ...) as waiting on ourselves is a blocking operation. In the case of setns() we explicitly disallow use of PIDFD_SELF* as it doesn't make sense to obtain the namespaces of our own process, and it would require work to implement this functionality there that would be of no use. We also do not provide the ability to utilise PIDFD_SELF* in ordinary fd operations such as open() or poll(), as this would require extensive work and be of no real use. v3: * Do not fput() an invalid fd as reported by kernel test bot. * Fix unintended churn from moving variable declaration. v2: * Fix tests as reported by Shuah. * Correct RFC version lore link. https://lore.kernel.org/linux-mm/cover.1728643714.git.lorenzo.stoakes@oracle.com/ Non-RFC v1: * Removed RFC tag - there seems to be general consensus that this change is a good idea, but perhaps some debate to be had on implementation. It seems sensible then to move forward with the RFC flag removed. * Introduced PIDFD_SELF_THREAD, PIDFD_SELF_THREAD_GROUP and their aliases PIDFD_SELF and PIDFD_SELF_PROCESS respectively. * Updated testing accordingly. https://lore.kernel.org/linux-mm/cover.1728578231.git.lorenzo.stoakes@oracle.com/ RFC version: https://lore.kernel.org/linux-mm/cover.1727644404.git.lorenzo.stoakes@oracle.com/ Lorenzo Stoakes (3): pidfd: extend pidfd_get_pid() and de-duplicate pid lookup pidfd: add PIDFD_SELF_* sentinels to refer to own thread/process selftests: pidfd: add tests for PIDFD_SELF_* include/linux/pid.h | 43 +++++- include/uapi/linux/pidfd.h | 15 ++ kernel/exit.c | 3 +- kernel/nsproxy.c | 1 + kernel/pid.c | 73 ++++++--- kernel/signal.c | 26 +--- tools/testing/selftests/pidfd/pidfd.h | 8 + .../selftests/pidfd/pidfd_getfd_test.c | 141 ++++++++++++++++++ .../selftests/pidfd/pidfd_setns_test.c | 11 ++ tools/testing/selftests/pidfd/pidfd_test.c | 76 ++++++++-- 10 files changed, 342 insertions(+), 55 deletions(-) --- 2.46.2