From patchwork Sat Oct 26 07:24:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13852102 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 437B8D10BE5 for ; Sat, 26 Oct 2024 07:25:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B6E1D6B0083; Sat, 26 Oct 2024 03:25:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF5E06B0085; Sat, 26 Oct 2024 03:25:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8FB7B6B0088; Sat, 26 Oct 2024 03:25:30 -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 691DE6B0083 for ; Sat, 26 Oct 2024 03:25:30 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 9FB98ACD95 for ; Sat, 26 Oct 2024 07:24:49 +0000 (UTC) X-FDA: 82714917768.02.51FDAEC Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf14.hostedemail.com (Postfix) with ESMTP id 6CF37100004 for ; Sat, 26 Oct 2024 07:25:03 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=F+FsVWKc; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HOxA+Xhi; spf=pass (imf14.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=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729927320; 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=+ODKNLRXknsw/fzUciAWVQgmpJpqBdi0njl3AOqN6E4=; b=OvJrrk+POdo6DdqM2H1yrjzONkLNJ6y9nWlYl6kL4pYyaDkmwDfZa8E6IMwaRR41zwzx3j +hi6tXdY30lKioRW9RwGYXvVyV2TZPFhsA/HWFt2iKXuDBmpsDqLIRwxYNIMrAmc0cAKh5 64O0feS7vvEM+ck41bHJSdRu7GtVvYw= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=F+FsVWKc; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=HOxA+Xhi; spf=pass (imf14.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=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1729927320; a=rsa-sha256; cv=pass; b=zIz24sPuee2fz44Up9soej3z1Jh/LYevXLzljSTMwStt10JPg97ZXc0ndh2kK5yI4PemBD Q3ByWik9UQqpXEJAwyHzktZZB6D2MbQqx+Auq2hT6Bw6Zb+5i6x9e8Unbw+25chiItlsoV l7w10VlvRwcVLMYA0QYXIAZuTL02nrE= 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 49Q6XQ60009017; Sat, 26 Oct 2024 07:25:12 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=+ODKNLRXknsw/fzU ciAWVQgmpJpqBdi0njl3AOqN6E4=; b=F+FsVWKcsjpH/ORFupEztD/aKnuOtACn BA1IieQcnJekOmJhTzOFm8RUV6lf7Nq+iT99CYymAS8TgIXjBNtokNVhD9en84+l DwFzsOV66ixBDx/W5PU5Tt+onFHodqDNHZ2TIKNs9LzQT021TEC74sQS0SQ03Pv5 zzGnzkfgh+KyeSnx8lEYMDmXi9CQ9IMD0cFKKfLsbR+s20+t8hrI7b0bp1waK3RL aAXYmTddG4cS8DM5xlSUx0zwWX7c9b3vP30W1z+EGLCsAaZ9LOc12RHRNyO2eET1 tSqBB/HLyfIcBiDZKPuCiSfH4BJu5x7tVgcj/rbyNIRH0zIWalcu7Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42grys043n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 26 Oct 2024 07:25:11 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49Q3DiQN018938; Sat, 26 Oct 2024 07:25:10 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2044.outbound.protection.outlook.com [104.47.70.44]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 42gpvacv8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 26 Oct 2024 07:25:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ohKV4WQnVO/JkfIDK7fP2+jGRgMOEjdqWJkx+SqoFYCo7bI+jaTcv9ShMD4IVYBN6T6++cL687qFMpHWeEtw2uRnGNgzHAVxOksWIVb+WZpXV3kXudgV4lif+HqTAvNwVxr8+bTUA45FAbrfG4+aBFGU1Bk+FkXooAYieI9cltb6IwWxuwRdsfH6vKzwU/hSMgOOox743sZ7F2x6kOrqwtJJAtJDzrkVRbWh+ZmbkHovyqQY0AWgH7kr78ZP/+cc5ttLAgse1Hy20stt9J/H7FDr4VmTNR79qDCyvqqhM3DwD6TL6M+Ci7OLWcix/wuZmgAKlBEJYkO05o22Y/KZhA== 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=+ODKNLRXknsw/fzUciAWVQgmpJpqBdi0njl3AOqN6E4=; b=gYyFssjPfHmEi9mh9+Xl1dBne9J+fO84Frt4wo1xhYEZdpR1WzOkgTnOjoOByc//QGnK6GpkPrnSDZ34a6pZ6GFKxIagttvsaRGCn87OnLg3SxyoYvE7c46Js/SmA9npG9BONja6gSGA5dbgvMrzaSt11SiYfiI2EuMLFqla+7w7+PamO+TwWCaQbe21ia/LUXXqdc61Hx43iUnQh/ZBJZPkg12g2xNBWtfmpZo16f4kJAVOpJi3lCtpWNWUjdGY3WnMGSMi+L0VKSkQbNsDG6EZdGYhZIrGEWTqTJQPTsDreHbzoBg2EWJuA5SFeAHwg5kKOyhU15Oeq8paERbDCg== 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=+ODKNLRXknsw/fzUciAWVQgmpJpqBdi0njl3AOqN6E4=; b=HOxA+XhipZN4uOwe1E6Wipu8N3nb9Ydr0uJgTrQdlZa0ozxisESztjDqrF6T/RhnhpbsdYkqvjRPlR1Gh3P4kFW9+xFkv/vaFDH0oyU3mjZaKnlHExZIa7Gtn1NnB2GFAhzwcNc6aBSdsPOiPBSZcXc5qMRl1fyZ2FkBxETjD3A= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by SJ0PR10MB4543.namprd10.prod.outlook.com (2603:10b6:a03:2d9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.23; Sat, 26 Oct 2024 07:25:07 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%6]) with mapi id 15.20.8093.014; Sat, 26 Oct 2024 07:25:07 +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 , John Hubbard Subject: [PATCH v6 0/5] introduce PIDFD_SELF* sentinels Date: Sat, 26 Oct 2024 08:24:56 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 X-ClientProxiedBy: LO2P265CA0283.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::31) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|SJ0PR10MB4543:EE_ X-MS-Office365-Filtering-Correlation-Id: d3e7ab37-8770-4f7b-b4ad-08dcf58f5172 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|1800799024; X-Microsoft-Antispam-Message-Info: l/1pzv0Od61fSVqrCixdnx1LWe/olKnEzgfBMq7ooiwTGsVUqoomgzVHTFn8sI8PEWeDM8rRQSAJfNg33nTOWuJqC0Nbr0Yi27Qb7hKy9vfi114havMrIC7BupdEqBt/ZBYzJNNcewRDadsszNbN0VNKG2o4jHKO3wrlrMHQSiMxjKGp2Iv9tvFVIWNl0P5JSZQ6s6iNkseJ50glT053mb8/wB+CJYTnBR7ngMS+275NqHdJMCUFeCaLIilr3Gi5zcc5fURUsKgt1ZfrRrKUuNYZBqoFMGwdx32zK92U0YiCMJPa9r8ZrCadygau4E1IG2ohwusimKB89StzJn97RJAGMM095d+52bZfp6o6C/VAo4rx0RWU86w6fC71xgb23fzpSmQgEv24HJnqwpISOymMsXa+F+6TIbnSP8gZ7A32YnIJZVxgwXx58fZ8lDl/APSdazMTRAN9vTxnT1XA+aDIjU7E28efKyq71KT2ZzWtplFpyOTmJM/e5svPO0gcslZ90jGCZViyV4zK+sK1Ds1hZ2e3eK+iOcdP749zG4A7sthjVQhAWspjrFJ64Vf2GRiSS1san1GhrAEFn80fzgUv2cL+NlUvmPE2AsWAFqJg7R2hYydGAgtN38A+KZRh38j3fgf6GlFb35dJrmYGzlVmrPmwk7ZrZAnwsbBpaz9CQ1LFoBHYO4NRNBi4at9lQKZM2gBjcdXdGrqW9IKiG5s9AuamyAfyS7c9mNAV7sRD6aLzhOchmUH5GiJPn7fO/burV6Sud4lIbVkIBBKLwSQCT0MyVuv3SlJI6FXPAF/7MTGls2ROR6Wzz4sxKfRrfxChdOOA9kSel+R9K2PSDgFbpURlrl4K1MWsOzFkJLZcy7RvbjpbJOAodEJVHOkjW02svPgUNz3b5dgSTYUAdNFmGTPTkK7IzCmVZW+L1r24YnxzEMh1TDKXWqzjldSdobN92C6NCQ7bzCk+SeJyevfTFL5MOdtf4Gm2daxQQZ6zNrvJrT3FYgiBOrsZAjlzVxLAbMWWSyMRY++ZVU65ojNE1vTOgEb4shZ9NUHz8LbLWUWQ+1YrohxnviW9kRCieXzQYagg47CuPArJvjLskBn0iPJIQ1bszEdkxU0erCA+1fgQhr/EA4f0KBfHXwgN1pkcI1Ea3IXXNVjftstxW3GtC/ZT1xODYiElQtRbH2WSlCaQ6aa9zdPQaCz58kmmnhYaUiDDPVQK0afaDlFbV0Yq+WYaTqp96UrHOJhRuGD4o/u6Z5T17x7mYRJjB1GcC+yeqr9btCipxCcgE+h9c6XE2OoetlieossS8shpRHbZQCItexSvfJHmM0bCXgmv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3366.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WPfG5iyeQDr6HwIhD8Jzzt6AZ0et6B+X2phgQP8ZFekCUaTbpsXO7ZZSofI7hVSRk7nMOA1yE5kTLKaioUNnxURhQFwq87/z1VsLY+yYvsLlgy58TYP/uQbpxhK/cTEaDKeFyPXN+07QQqwg42Qkaf/yFTASus8Iow0HuOHJtIVCCSptacHKc65Dv/cTBvC0qSbornJ4VsrQhW44tIapRsabHXXfdAyn7ZiyOWpZ4Zhzr9CpVFoegpbDcAB+62ntHuFhpbQHFP1qocgkuE8IgR2yeNUKJ2zLX3uLbMM761nHJlRdwdZ7QNm6Ds1DuiUocHMqaPpUDi8UHTIg9I7GsDqzF9Xr+DeurD2Px6MoLBK6lsqoMriovCgrJKExPibvtds+gra4neVmJ7kQTm4OG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srD5y0uDZJDfc2WRv81Xn6iSK1RQc5Gfjg1T94uIZ1QombZe3Fw6pn8EOpellS0zVB/Cs79oPuIVw7CkwgB4y5hmbzsHr2J2Dw46SohjB0YI8SlondbjLU6W3YOzvbVbgzXXtTHAeUZH92fbLn7yyVvqe1Oag== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ZzmRHzcJfTmA2Hc/b6ABjb/zrGz2QBnAjgt+qxgybLKmo/m7Gkk9Tin9igDrDNhu6Yw3oRsCvEAO1pS734Wuc/SMxY0HE8HfRMYmNf8iwlHHlElVHbaXp6gcwlBUSE27UYtxGXeoWecpIj9ujMe56lWEmO65/A/Yr80EAiEbk8SieyvX/NO/SYG2R+EwPvdD401SivjwFnchTm/5mANPayvpxenLPo/CzrXIXtgbnOXcc3WJMIrLnxQ2us+Z3CZPolPaknFALZMiAEJDquJ7n0a+GneBkGaf7MKB3Zy4N3HveKL4PpkVzQ34xL2xXi8IW9Wrxg7UbEaB5J21GusasbVY6NrAzL4QIzvkHk8XYLbjlYYC/Rb/SiXOj25YDx6O+a8mEVMIqDhOKKCfx2ojwWW0Z4sUKorVaRr/WqRQnwX+UGh2fPzJzal0y68d56s/p3VaUJWDjfXZ6sqcsfOkP3x0LhZedMmnFd2xcty2YJXVI/r9WE+yYnx5UbHSFLWykKF7UT5dcgC+4aEUFhY30gV28vrp9uBoHLo30XkYxk0E+trRI3oBBHribQFCkUuLtlw62RGskrvjERtAqpwoP6Zcichx+GCh+f5kiZcQk0Y= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3e7ab37-8770-4f7b-b4ad-08dcf58f5172 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2024 07:25:07.6576 (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: q5iTyXXdfTg2l0yjE82V5C15hQIy2tBSOZX5p0PK5IoUc4ZjGo0LC5prvX49a2lCPbilJq9zbSAaySyoQd9UHwy2cjixpgxjV+M+4ETmpMI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4543 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-25_14,2024-10-25_02,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410260060 X-Proofpoint-ORIG-GUID: iSIvAlQlWHybOwrwFk7TUjZAeSXuMYWI X-Proofpoint-GUID: iSIvAlQlWHybOwrwFk7TUjZAeSXuMYWI X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 6CF37100004 X-Stat-Signature: 985arofw78ih6i6ic4bdkcf7zjqd1j4t X-Rspam-User: X-HE-Tag: 1729927503-536968 X-HE-Meta: U2FsdGVkX18Jw/X/+I2X75fJ6GQTAsffrxY1C8Ucakx6gLwNJYad1WsVRXwnbfhXt9qzmuiWYbCLlAnnSjSGVHFjUVUKY77ETyq1za+s4jba9QyjBwFqi64HiVucCyewRz5wZKCIUTpj1LtaxiJ10HyzwFw6kteeomRSOPxFoTvjbnocNy2u+jOfJWSQIrILojXJnFxXUwma1owky3/VmLzAhSF8EJliwgSpxduMk+VLEEmFKpfgl+THBZpceBW8L2Hmzfu3ZQRkY37wmM9xTgGMbyMQDI629Q290ntI2NSVvS14J2GfuPy1Tn+GWFy6b7PlVly5oRzsKx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QCq0olw+HCdZm0VjgtCJqDms9gC7WhSNqlv2+Mmosypm3p31uuJbIyvYdgNyEttPkUBfBiq3MMQ9bIhknJJQ4y3fNMhVehhx1pcy1UClE961Srh4RAtavy/ndLNhawPaH8/eTVSRoiSnDA9oyaE+ti9cn+hrXNhrQbBViLCsjFkJoxocsAedHIit7cf9WFgTDtGYKCZEKHemOIvXJRYw1rfHBOAd91HzTjHC8kPHCPeV73KOmhy7g0l49 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. v6: * Avoid static inline in UAPI header as suggested by Pedro. * Place PIDFD_SELF values out of range of errors and any other sentinel as suggested by Pedro. v5: * Fixup self test dependencies on pidfd/pidfd.h. https://lore.kernel.org/linux-mm/cover.1729848252.git.lorenzo.stoakes@oracle.com/ v4: * Avoid returning an fd in the __pidfd_get_pid() function as pointed out by Christian, instead simply always pin the pid and maintain fd scope in the helper alone. * Add wrapper header file in tools/include/linux to allow for import of UAPI pidfd.h header without encountering the collision between system fcntl.h and linux/fcntl.h as discussed with Shuah and John. * Fixup tests to import the UAPI pidfd.h header working around conflicts between system fcntl.h and linux/fcntl.h which the UAPI pidfd.h imports, as reported by Shuah. * Use an int for pidfd_is_self_sentinel() to avoid any dependency on stdbool.h in userland. https://lore.kernel.org/linux-mm/cover.1729198898.git.lorenzo.stoakes@oracle.com/ v3: * Do not fput() an invalid fd as reported by kernel test bot. * Fix unintended churn from moving variable declaration. https://lore.kernel.org/linux-mm/cover.1729073310.git.lorenzo.stoakes@oracle.com/ 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 (5): pidfd: extend pidfd_get_pid() and de-duplicate pid lookup pidfd: add PIDFD_SELF_* sentinels to refer to own thread/process tools: testing: separate out wait_for_pid() into helper header selftests: pidfd: add pidfd.h UAPI wrapper selftests: pidfd: add tests for PIDFD_SELF_* include/linux/pid.h | 34 ++++- include/uapi/linux/pidfd.h | 10 ++ kernel/exit.c | 4 +- kernel/nsproxy.c | 1 + kernel/pid.c | 65 +++++--- kernel/signal.c | 29 +--- tools/include/linux/pidfd.h | 14 ++ tools/testing/selftests/cgroup/test_kill.c | 2 +- .../pid_namespace/regression_enomem.c | 2 +- tools/testing/selftests/pidfd/Makefile | 3 +- tools/testing/selftests/pidfd/pidfd.h | 28 +--- .../selftests/pidfd/pidfd_getfd_test.c | 141 ++++++++++++++++++ tools/testing/selftests/pidfd/pidfd_helpers.h | 39 +++++ .../selftests/pidfd/pidfd_setns_test.c | 11 ++ tools/testing/selftests/pidfd/pidfd_test.c | 76 ++++++++-- 15 files changed, 371 insertions(+), 88 deletions(-) create mode 100644 tools/include/linux/pidfd.h create mode 100644 tools/testing/selftests/pidfd/pidfd_helpers.h --- 2.47.0