From patchwork Fri Oct 11 11:05:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13832424 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 945D9D2446F for ; Fri, 11 Oct 2024 11:06:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 262F36B0092; Fri, 11 Oct 2024 07:06:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EB756B00B5; Fri, 11 Oct 2024 07:06:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0AFA6B00B7; Fri, 11 Oct 2024 07:06:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C9A8C6B00B5 for ; Fri, 11 Oct 2024 07:06:20 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C59DAAC9F4 for ; Fri, 11 Oct 2024 11:06:11 +0000 (UTC) X-FDA: 82661042478.06.1066913 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf08.hostedemail.com (Postfix) with ESMTP id 1CCB0160017 for ; Fri, 11 Oct 2024 11:06:14 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mfEYJIFb; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=N32P+l1+; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf08.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; 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=1728644639; 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=HgPbyjLwfkDCmIhKjkAHH1dEUwzqOw1+cfVEyzgdHD4=; b=m/6rmja8mQjeNaaxe2nwHDzizZ3Ck+mi6Sx3TpI3ZXSym7f3Q4e3HsN/pK+6aiOWqB0nfW 6OliufBSGwfycFStWdnDTInP5TFkF1lThw/zDWIPusmf710WUxflzAsB5f4VCyZBsjRC5T DOUTbqnxPgJwskL7DP4ESsnAJG9sz7Y= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1728644639; a=rsa-sha256; cv=pass; b=yeRFJp0KSEJxggJSkLTrjr8fKNvTCMLt7gBPJYnK0gZnahv8dXkbGBrowkHjHYw9nhPnUj i/hew91Ie9Jk2NDjqibStpEvz63roKB7mpvJET2iI2p6qN2WFzf1zt/TM327pjLVbvUoZ5 34PFmaf6pdCHgZISkymTfIGY45y0JOI= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=mfEYJIFb; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=N32P+l1+; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf08.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49B8Beeg030628; Fri, 11 Oct 2024 11:06:09 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=HgPbyjLwfkDCmIhK jkAHH1dEUwzqOw1+cfVEyzgdHD4=; b=mfEYJIFbv3i4CelDudxe8ENLRfo3NCaR 4qTDitevybN1/HgcBZGZVNLk+0oR9ivevmv7TNHu9sw7Bv9jxvpwXDlPD0X1iozV aQf7bSkx6ETmxYWFWOiIFUCFjPmcKSwjQByqPHwNgi2xrZpxIyt7Q/s9nH1C4S0L he+Mvz2yqVwPYvu/L+DK7eaJ4JQ2GIxCCe3DoXy4VReoanKMyUr2hHpeUe6mrzWk 5vm8cyYZ21QXPIjxCS7xMoO1C34yilww+Wj5WB+wtV3XdtomXoAeINhcXq2aWbaO tcPYF5pDsKNzmb2WI9zb5d9jfF/bNvcpq9fERZnN7KTUaDy8q6dZPQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42303ymknu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Oct 2024 11:06:08 +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 49B8soxA020626; Fri, 11 Oct 2024 11:06:07 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 422uwb96ur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Oct 2024 11:06:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nm+f52jlrNLCHVDIwmww+J8CF96xF6dasmdyx32GgnvKnQR+M75RsKhpj5hyx3fH6GdUfuHdryTCREq8x/VzqBFcC188REJL1mj28NFodo5wNQ/VrG3652luQYuhdLsGOX+GKmI3GqUEUYtOlxY/j62Zk200u4tsSlDc9Lf8MMw61XPa/StIqj8v/4Iv2CPpDc0FvEVIxaKL7DcxDy/D2tG7ffhqWcnQzmvC5IqYR5KSUZ47e+DFWCJEnEY15uZNx+HuLmL4S4yO+mp2Z4Lo+huGgO2L9bwEMr1n3/Y8wBkRG1FxBVa4yWCoCLW1XMhCDdp0UBo7DDqW7iOlPKAWEQ== 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=HgPbyjLwfkDCmIhKjkAHH1dEUwzqOw1+cfVEyzgdHD4=; b=UXSsfNFGJe3VgrwCHJJEGW1re9yRGoCCsD4hoEBKvVIO+9xxRcDEaHbpCj1w2bujlhx62Zep3f8NMJQnpeqrhZ40/ybh7XNqDue0LMrtp2XJyNpcTzJnUugBWvxxO54D2wBNqE3LiWjKi3Vht0r2+x7YVhU17GJGzsudwgdsVEdxcZW4VtaziyjxgNV9xDCGXAHA9G7K87n93qUJe0Rzny8dLdpNY2JwvbXcBz+XBbOO8R/QampnVmFWBCx27mSTwbMH07HUa0WpXX0oxFbc6BE/D4nP/pq946LtWMKniK1JPH+nM0dj+pHYGN63KDFhJKktxoXUFgzTOoTj8D1mEg== 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=HgPbyjLwfkDCmIhKjkAHH1dEUwzqOw1+cfVEyzgdHD4=; b=N32P+l1+yB/B+RidrJdFT+P1PYJk3KxzisMtllJmJ/8TVbM/YrNOaGOOMRxDPvoNA+JQM5btWkkM8P/A9Gfrolxq3YnQTex+12Au0UJKUozsFG1aexk4Y7LvWo1vFyXr16xvo6/fSAvCMf3pkEUEVn+POFF++So9zg4EuVooo48= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by CY8PR10MB6708.namprd10.prod.outlook.com (2603:10b6:930:94::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Fri, 11 Oct 2024 11:06:04 +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.8048.017; Fri, 11 Oct 2024 11:06:04 +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 Subject: [PATCH v2 0/3] introduce PIDFD_SELF* sentinels Date: Fri, 11 Oct 2024 12:05:54 +0100 Message-ID: X-Mailer: git-send-email 2.46.2 X-ClientProxiedBy: LO2P265CA0056.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::20) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|CY8PR10MB6708:EE_ X-MS-Office365-Filtering-Correlation-Id: ff4dbe57-115d-4adf-2732-08dce9e4b2a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|10070799003|376014|7416014|1800799024|366016; X-Microsoft-Antispam-Message-Info: 92smYy5liFpZ7LSItL0XI9Bv4o6BNvyaDdcBHfBM6latqrhbJ2buMHoatAedl8ORrsfz6KZrMIEzTsALCxhFfeQioR/M27QAnCT60mDrG42Hrg/nw0dLoDcL7mF+yHR+kU2g5tX0pGiRDhCWPewWnMK/I7TXlwSm9vZTZUGYE5qhCj8muw8kybATF73snnUuNTpDcMkIZVykvOPeBD0cFkCYwzlY64AmLpNkvp3M4TEKXjKqf1GCtx6sL8sK1eb8TBQ+5Q8bZYMiNH7oAyuhCfYKjXaH7KBxKQ5xpBlyB2ehWujO2juwpZep1TOoPNr1pdcQUGqGGeFm723ka4NNzOh7uHn3NuedmYHVAWpr0EqKzflSMCOHOsK/Kg9LkVbUzagJVOCuDmSJ+LmavJpekLkHMGQQosYRBLlK3OXiarHfLHuzeR4Vk673hC7P3coP2ys1rVIZwJF3mqgNjcdFyS1qaLrKXz1gLL/GgsA6qqFAJRCuy92L1QliyWqBwDYdb/xuySibJMUnJB4nO+oIoJ3BI0cW4bPXffYVD+G2Q9WoPC/AOl58Pi7bLreYzqqtGbgIEkTpiMLGQ5prjVZzYoqSWif86FtwT02Pu/PvtYSlm78i2ZPVHnVkgbsQB+I7ZdRwOKHuXKa+bXutEyddJbvgZiSaAL+MUto8TEml9hE3pZGDnpxAjS3u4N9RIxO2VxDgJ/ca5heZzfPSh+xg7sBACX9BmKhjODGGw2XcIeHdfjBPy76ZbeibJN4sK/Qlgu8tARMeDU7cwIAPMuysB8HFYTvUiucq4B7/QqRpYUs+NlgAz8U9D6jNDk1Di/L8oUF9kUICS3QLh9DLGvxAAKkL+U338Hshs6t0nV+22PJAaBNv6Z6NZYTSzyoo3KK/C6n2jKAaLLbufJMqKiTKRcrfHHPUKPbUEuuQAlxXVqKM9Rbl7YmMQWVv+RzSW55x4gDfdTiPKMYvL2eu0IWaR+i9lKCNTI2McNNUizm4pt/AaRmHMPCW03XITom8Lqlqwrs4OPU3ZO2KwbvkwxQgFhxxLlO7SfHVjyiNYIfFm7zAHGM1ex77SYwjl2DOLwhsYZ4RsutCM5mDDfEiiAbGVuP2HVbHJFqKwOJCAQVdxXT4HIqtjL5KrBBV6NzxEqDT58HHpYI+0qP52sYFrGP/SwAudPg8SnwewgaXXWgl3x5XrZ/O2SFWF+bLrmJsWocQF+6FbmVgY3EuLV9nALQWM34EdCnvfZPlgLog2q7tqpXgVL0k4OMbLlKrg7NmXZL+dK3yNvO/M03VWU/4zps2N+tuG4iesL3iZwFJxtC5gyA= 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)(10070799003)(376014)(7416014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yWoLlTzjbEqn25w8CNgVjrkDGplNbErmbsYvBqVwHl2hRGSldTCcFJx0Ink5l7Sumjsc3qJG+IjzkiO28CH3Ax7tCLDGSypXcG/WGrWUJ+gjejtz/zvCs6gXl4wrSftOl1vdxZUBu+tucYOT1qu2mRB3IVlAukDk27lKEm6RFySCyUmMx+xHTAZZN4ZHMRkc4RwhJEj0pXMAso9tSbptPgz3gixKlcX0+RdtVT6LbK82vcwZwkSR+B8WuzHd5QpiuWPkVHwd6kQhZ+IaoAMOrHDDSR0MTsYDFbgXmWQ7m9qIPEBukEwQa8rwM0E8V8oU1igCPXyc27OHLd5Rly9qf8fgEgujDacfgpzhZ/jXILg+gCkrUQ0InStNFzsLbLZDEbapxSS6vgI3IipD1l3JoyDg1I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tQbrvrBUYhcK7cIh6voi3RLwS2MeLc4uRd1t9uTJwo/FGi4hBxFTGFJT5lVEIFR3OsvauXr7Jofcovfcsp9aN+CzbvQl4Vp6vw+5z6dqTPdUqhq+vLBp7B6Idb3zsQrS8jIYD6dYEN77j1L+xnKNVJoihSMFx9ylI5yrInV+gMLSq5azPmjZZJw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ZzZoY7uhYmoNZ52c7nKuto0TfQp7lfk9UBgLghrD2cyCEeFzNudsLNFGZPJIUE0cKXe72QV4CyVpkauCmn/nMS5TccDbth6yKXrmZXSNj1CA4IBkOvq9bJeyhLKn6OadXgj09suUL5YBEQZlrP+TpD6dfrGZp+E52MjFMrBXnSkvMhvBO6RoJk6VPCt/eRGInxpDJvNcpWrRoWQXpwtk2YnYrSyLUlKlKhaaLoJHAOOjLWBsgGOUXIyjR4IUhIdgECKkWm3DKlBdmDHPq8/Y3kHixf0zeR2mpDaWjoeSjDh0mVaOAf4/RQfC7Z4Q9ZQ71mgXhcBvdXsevgeypqwHArK7Pki4cl40w3BOgRkIl0Wgh3bwSsJquVAjAWkst8rB1HqdbaXTMcMkahSzWcJxxmQhg36eQkSPE3pYlU1fQr1Ey6f32FBtrQJBPSWPdIAV9SP1htZbi1Fbvsj6sUVXcYD7J9KDqCASHVrzkFus+vjX4vI6iCcwx3kzUfJmHZvJU40y75q7tKYLGYxsj96lxjWrTWFhmucPY3Ky7hsKUT8yIso8r7Z/8CBuxy3c/BNG4S2qidQAPoq6HWSqrl77szojJOGZDX/NYHp75B/AZ5o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ff4dbe57-115d-4adf-2732-08dce9e4b2a9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 11:06:03.9742 (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: OwoBm07tmrc6dC2zz93wZA7ryxgzF1ZXwS+H6QReT1Zv30ndL/2X4NcVppSBlGtqT6OXLO9ssi8oK8Q/K9Xhn2iXMs8eNwCOzwuXBSVq/Og= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6708 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-11_09,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 suspectscore=0 mlxscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410110076 X-Proofpoint-ORIG-GUID: itQfmex1KoEK1Stbc1Vw55y--bxvugZN X-Proofpoint-GUID: itQfmex1KoEK1Stbc1Vw55y--bxvugZN X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1CCB0160017 X-Stat-Signature: toyhqjk6f5r15twzey5ehmbom438re7g X-HE-Tag: 1728644774-82071 X-HE-Meta: U2FsdGVkX19WFDNw+DNgFP5/rmR7UgIWt9tQjKv+zdB3JF8+LoQE9ogqs3HY0OkDjbTGTCT0PaIy/3Wc16sbr35JeZJi1ERXvf9ikKBQI868sshKtZv4lqM9j3SgLTGeaEknEmpS/5pCGp/fy74Sw1EYiqKqFsiH17GywxSe/W6sHXwgDssOZmYeYGf6vCwIse7bT0vTEglVC/DsKwLu2lXSCx9+5oxujUMiLGb+5RzAmiOxO3+0Ur3jI/jty1e2L3dbnNFFtzWqG+6vfB8s2EbG3wjba6/oUVaqPuBk2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YWxFH7g7pMW26uDBOI4EBXGtTU4gOGC81WL9CcywLOZipuGxbp+WayjyM/iLqfY2hyLNubOZFzIxg1u/zk96Hf4QPzz1fu4QxobWls5Ywh4uu8n9wQRIMyRxI8hc95iN/k2yLYTtFLheTpxTWEv0gwrV374F3aE7CxcnNutWop/ILhb+kqt/osFuARkTv6lJbaKA5oU2XtbuiwSy9frAghJyzzsNGZIxRfaJYhaWbg1/WT+rmRURDTZ/1KD8AFBQ6HCZEBVCviLc78pMpY9vnIAhywj 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. v2: * Fix tests as reported by Shuah. * Correct RFC version lore link. 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 | 22 +-- 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, 341 insertions(+), 52 deletions(-) --- 2.46.2