From patchwork Mon Sep 30 09:22:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13815720 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 467BECF649D for ; Mon, 30 Sep 2024 09:22:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C83616B0137; Mon, 30 Sep 2024 05:22:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C32EE6B027C; Mon, 30 Sep 2024 05:22:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A145D6B027B; Mon, 30 Sep 2024 05:22:51 -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 762576B0133 for ; Mon, 30 Sep 2024 05:22:51 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 38BBCC0193 for ; Mon, 30 Sep 2024 09:22:51 +0000 (UTC) X-FDA: 82620864942.30.CB11D16 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id D9403C0007 for ; Mon, 30 Sep 2024 09:22:47 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=KnHv24T6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nL8LDsBm; spf=pass (imf22.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=1727688103; a=rsa-sha256; cv=pass; b=AxWGQ1T/CJLd6gn+OhqR3xyN+Q/SFKWmghArisqhY6xCB86rYAKDRnGVOnEQMcpCU9Dp8H 2oXC1vAjWrq0rOuiFtqaSXtQ+Dxk+A54tpfcTASo9H9X7HV9Vdwtx69PZqUeu1YqvFHQ1g HzRVyHrmvToQUKQ4xpyntjxn4b1VpOw= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=KnHv24T6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=nL8LDsBm; spf=pass (imf22.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=1727688103; 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=rCQwvosJvQI0P1cnqE+4LmW7afIbhfLEv7wz84ZRkdE=; b=RNTMccJ42moELfPwgUD21S1Mjds1NhR0oduu3kvDfcNZYmFVXKp5mOXEAihE9sVmTYXnBx +dor/aycmkHJeiuC1s31RopB1tK7KPmNr6ch2WFM2T5HlFu0kpR9tJI8GRdFz5aVpuPsIU 3nTKrmSKILpRNnmYDtlwuLt8WiuvaSQ= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48U2tmpT014356; Mon, 30 Sep 2024 09:22:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:content-transfer-encoding :content-type:mime-version; s=corp-2023-11-20; bh=rCQwvosJvQI0P1 cnqE+4LmW7afIbhfLEv7wz84ZRkdE=; b=KnHv24T6pvXKXRXV/ZUQGOW3OX9QQH 0XEQVdLZqmAm88MDGV5M63LXV3slyap5UmiM3PoKxqhiJNQEXvPKEzJnORxkaOy5 pCJ1dD130zeoFIOc+plQCXMlxVrGClnCnvRKMI8/tYEa3zYKturMqFK041gL82vh DNaEgyYjJhbFGUY4DdKeWoF2oP7a4AdqrnygWv85L3I7rQM7MePDhHE+cyJjZACL 938mzobnnJkzeTsfhOZp3mXzMUUT3efnDTqiM7/hJXl+TSqsJl++VwH6iA8sIgcs hbq9zZFtPmgUTIOg9ShJFJTXpqezQBH8V/Z9xmPqmeOoSy4HSvg//RgQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41x8qb2ttr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Sep 2024 09:22:41 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48U8A7Yq040635; Mon, 30 Sep 2024 09:22:41 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2043.outbound.protection.outlook.com [104.47.55.43]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41x885stu3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Sep 2024 09:22:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kToQDdhd2uvu7bd7ZPDbRg/+SQ+hrflm3e4LA30i0GxiDKOJRgYYN5mPft8SxjmBEGi1EDklHL08aIz/odIOhOc1IPgYn6vBDxBm95Swo+ce4zcxLSsicpBFAXPwoE88JM6DHf0QrnxS3ZrLG+e/n3mRlfA+079f2wJ9TUL+yHrtzXOeZtdDpOmKcf5wnApG2AzqK6cfOp7z9GDOvH3PfGxXaB2xyzq0udG5yZ34iJ0OwfIgcQ/QEPynQ8CdoKWnfew8bL72CPy2SO/DMCvZY6shkI1EWmpSQeRIEJy3bMS4evf/JmpP9z1um8Ettop551AwjtBoGIpwxiSCh+fpkA== 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=rCQwvosJvQI0P1cnqE+4LmW7afIbhfLEv7wz84ZRkdE=; b=QaloSIi8Vb5uQ1jbjxmEmqHdDDbo5Yveg41CX5t7ben81wNdPsemA9FNV+ly88H9XjO22gfanqzNhwxhRFCSKVmtPtW9md/5k73Zwb/7d4htr8e2EmMO+P1QA2MBUItH0R5IHezfIh2gruDNQgZwufIRxB1QttOxo+Vo+ESHUhtXQGASQh9odkg668GljAJRrrP0cKKbRlkD5W8+1VxfigGhxfiU0eKn8yuBY2TPLWvgTEGDSeSwjfmCvj4+6kTgqZ3oXsVsxe25BPY+UAqC+IhYhA4UqmtDbMdEXfhS2ZwY5yuAkQH5A4IXPMUc6G45D4svrNc+IWqKZdsOq0Y4vA== 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=rCQwvosJvQI0P1cnqE+4LmW7afIbhfLEv7wz84ZRkdE=; b=nL8LDsBm3D53hNU2X/jYWKXjaTHARG5/PO3uA8SluRcCCeeEF6dS3IKmvRfofPmMJqt+8VmEQON7HGP4AxhUinVuAMDzo84IW38fFHslf7oFozvLbbSzwhPDbTgl+ofjP3Z6wV291d4zk3T5U3fHK8+d74Efg2pYa2NyxDMp1No= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by SA6PR10MB8134.namprd10.prod.outlook.com (2603:10b6:806:443::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.15; Mon, 30 Sep 2024 09:22:38 +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.8026.014; Mon, 30 Sep 2024 09:22:38 +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: [RFC PATCH 0/3] introduce PIDFD_SELF Date: Mon, 30 Sep 2024 10:22:27 +0100 Message-ID: X-Mailer: git-send-email 2.46.2 X-ClientProxiedBy: LO2P123CA0063.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::27) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|SA6PR10MB8134:EE_ X-MS-Office365-Filtering-Correlation-Id: 66ffa0aa-8d37-4634-a772-08dce1316d80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: UazVXaK5Tr83Qw+eMJsjFwJWH30z9zCb9vaHvTJFt4W/RFj0mLOlIZlvRXa6I3AiGJqU0XqdhLozv3Os73MQL9QctXx0ufMYTvoiil4F5acM2fdNmjBga7tERmSXfgiRNvZf5mKsDT5YvIiZUAAnpPkQ6GVPhpt3q2lgtNlaAxBkeQQ79VmmuXQCD+Bh/T8hHE4sTycymWAIjUu6f4FnGkeeRKXymMas7F3eZ5JFZz93dau40gMKs4LyDgyLbYf06YqV6h7VVcSIO7PE4HO1xcejkclGglBmhjjG4LPL3SKBVkGDcPSGsxKFaHWtl6B3orfqyuNfg98ZLA7YHKkLJo06rbR1QUKXc+hk/sep/fWOpWrJBTmxtwfidJseqIxaZMCBXcckBXZhY3vwdz+Axm++qAV4aOQytX7eO+2nItRx+JSrRv0lzNsIIPf9qzJUBTIbl2yWEZYsuNa24mgpo2FImzWhHx0DGez8/R/dN3Xa1WwIEtS+WQDpS6vTcmZoBjMMuyNERwkuhFJL5E9qJC+/nEWX57S3XFj8GcXOLXgP7HWbhCUl/sFl+9mZTkYKl+0MZQqGhpXSkYcE+uhA68eBa1TkBbMSyZvQAypkOYjOg6ycJFTU0YY0Xlgjvj9FZhvvrF/lWzFB3/KYRub54vFb1NLehbYi+qNszMEQOp1yFBEY+x6B4aC47WgPOE6cdu4dnVp5g+79igAg5hgYotEUNxeonQc7e4f9N0CAbWKUH6lfcHh+2vQZjetS3XFvXPE6S24nP0Yp6eDHtmE+NhwQMDpu/9s85dW35+O30tBwDqv6Kxosj7+AQC4V1xAzA5PASA+j+do21twmlhRpZuq2s3AksnLB4wYtvMtvrLCngj3NX4W8sLTN7i2BYuDi8Jc9k4R/e9bwEZLsEln4PtqAZ/K19+Tudsm3xJgXhpHjNnj0BnVIYhBzInZn2HqMAAzQJidr3d87acGBluflv3/dqZoXPL0HMLukMwbGFnMbJ3BZmfjfEsatXU5JRNQSEtPg2qMViifHnJmfYe4QgExbZ7Uf6hR64/kBA5VcScTOADO4foEFe0zu71QWluqd+fkIg18xhQeWO7D9zQm/0H32yHbRbBe6jZwCGG0GLFNq6moyOcw7T/pr4FkALBylXXZS0pcY7KZdhXCo5vydzLfHctS+gMOXl59DVITNCj97+NR2q0L9ZyMp7IzFXquqR5E+yu2+1rKFKxC9i04Y9HbZzlto2vFNdfqlB5xeoDbunrBMwtTg7gP38yyLCVJf0/HI1TDmhs/3fLE5DJi4IguxwboiZjrXWA5ANguxkva+IzirY9f48itobOEBMQPMFmB1i2GGt8wY4mKbkfNOqQ== 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)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a4yIoksWxFcVc6Bj8HEHwAUqtJRX9Q6fMXK5lzu/7Q8LOeBmLt1b1lX7Mg3rSXdu3AV6ffETq46QRHo21wQ2jNNwIp28A5LXbvFDpwqfdQ8v4M8eH62hyw2F1KahDZ4Qihf9gV8g9AG3x2rgSBaccYrxKsAr4cYI4pMQwNlW2cMkOoSm2TvUNhbXTkH98S5immwuzNL1CeH0QyEneQnFy6geludWPemspPYeBsEcp0mwDzL5j6hnMg3TERWzEE3oPZWBSBVCH+lz11M9DvblfGQZihLbhodYqNDvDe1bCmncWoaT4VWiMEGbObWRROx/25b221Ln/5BdFmYhEJeP4OJAVjYxOWrjZfe40JSNtGuOTCvBBIgihecXsrZN5zE8Irk/6oX5OvJ5lhVKLoa6F7ER9eQPlY7Qc7fi+bCJg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KNV8xa/psSuCQrLxExVSb18IlEHKwGcaaB+8KyshUp1m5xq438dOBUYPgmyJPchYW69Ch2HIluFi4RC2ii6POhPgrqFCnQoe0JU0ZE54eQvtmoEuQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: xf1nQYlDuO6tIlR1YqiGgsQYByNsH6Gy/rDVyfsF0l+JeGGakU3ubQY1nOjxjNEDAWDfmbJzbc+1sGyxmZU/tBl6POpAUYQWjO38r+/p7xfYC0F6H1GhwTdqUJdhBxuiamn2+ciDzZHjz6E6v1wdxB/wHdj61xbPqlaHchrJ7FubTfxVM/sdln7YddZ7S5apjPxFmK5aAzlcIQOza5Ofs55glYMbl/LzFmOVdlRDYrCasp9q9ZCIfrlxRSXwwkj36WM75Fz2Eyd/f4/uZd7VigZKvvQFUy4rPKKC1jCfmuoJtNevArT5hlL+Q7h/HSs1kvaqyRfbseZHw4JjVN9NeVFK0pexHyNhIb/NcOX/plB9a0er5CQTIJBP6H6VAspXykh2tWpSx9DO/4uZexK4pEawTntlFSOgho0nNPby0hMv8m82wvGJLfTEsH5w8qSvuL0KnjZuVtfJRwBqJIHzSXRUaSd75B6gSg01Mfwu1KZkCIjUz7TvGmR+6sy72+4g186mNeJiJRNz/iBAoUU7Dz6cKVuHOONwh2jSKoNvn5IZaeDVTKH3FUDg8daVbn4eTfvVb76U7xqqTvNQY+qazzdjpjxqeol02RwnsG+QBF8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66ffa0aa-8d37-4634-a772-08dce1316d80 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 09:22:38.7417 (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: xfehvdfeXUdPd7c1HL36IXrj69aMYTgvmbXHX1Oe2CUE5wm/wrGGUQh42rjLt/6hpgv4rhRooJh5P2dRX6aT5ZA/9/J8jWrgurJc6GAG+Og= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA6PR10MB8134 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-30_08,2024-09-27_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxlogscore=369 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409300067 X-Proofpoint-GUID: jPHW4st28rztRHqyTNmQyh53CAtT__sE X-Proofpoint-ORIG-GUID: jPHW4st28rztRHqyTNmQyh53CAtT__sE X-Stat-Signature: qsqoq4eihzsazya1msmmq7etnt3q9qiu X-Rspamd-Queue-Id: D9403C0007 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1727688167-428540 X-HE-Meta: U2FsdGVkX1/aEou5ExBuJYr9hRJCEXrtWn3ey9wjiyd8VeaHUCEqM/nHMZt3lUkyxs+7m82i/v2BoypFapuThAd7XA9iCMxxm6mKMPJjaWrsdz3LDLg1p7KK6eLbBfiKCm2nl6a8T50zpdHH+aMIAd31woreW10O7FbekUd1Zwz34nW2pwtp6XHsMAmHexwtBXK5DAkaBTLNbU/2ANpQVqmO8I74b+pRzQ/gvtdfiyCRDsy8zBZdBnd5uvtN4FrH0NHwf/I7ie4pjQarOdF/m8q+wL+rRqKr6eParhecEEaKsoLWbq3KC3zyOqQkF/5ttvNIZGK0ZlKuogon+SnJX/kkKLaRvIAfZ7IPytfh5cja+ztD+jXRXaFBYr9YDHiWtIVN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X37mKsSEI69Jzne4U7OxSfahsuvmOemmjzmsFWQiJ0VDLhz9VXfTI+KEXOrQW87YFludIpkLsTDjH08utjcaHv1Lj48zXWcNt1afqeCki6A4qeKIfOChbJJOdPTtKnGj+uiqNdXM= 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 (from the point of view of userland - from the kernel point of view - the thread group leader), it is rather cumbersome, requiring something like: int pidfd = pidfd_open(getpid(), 0); ... 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. This series introduces such a sentinel, PIDFD_SELF, which can be passed as the pidfd in this instance rather than having to establish a dummy fd for this purpose. The only pidfd interface where this is particularly useful is process_madvise(), which provides the motivation for this series. However, as this is a general interface, we ensure that all pidfd interfaces can handle this correctly. 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. Lorenzo Stoakes (3): pidfd: refactor pidfd_get_pid/to_pid() and de-duplicate pid lookup pidfd: add PIDFD_SELF sentinel to refer to own process selftests: pidfd: add tests for PIDFD_SELF include/linux/pid.h | 43 +++++++++++- include/uapi/linux/pidfd.h | 3 + kernel/exit.c | 3 +- kernel/nsproxy.c | 1 + kernel/pid.c | 70 +++++++++++++------ kernel/signal.c | 26 ++----- tools/testing/selftests/pidfd/pidfd.h | 5 ++ .../selftests/pidfd/pidfd_getfd_test.c | 38 ++++++++++ .../selftests/pidfd/pidfd_setns_test.c | 6 ++ tools/testing/selftests/pidfd/pidfd_test.c | 13 ++++ 10 files changed, 165 insertions(+), 43 deletions(-)