From patchwork Fri Jun 14 02:30:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13697729 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2064.outbound.protection.outlook.com [40.107.93.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFC8B183089; Fri, 14 Jun 2024 02:30:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718332223; cv=fail; b=hMgauUeRfTq0p93DpuBAxRd3aq2gM3uKUfxkmoOdo2lKDe5lZfdq9cL20nobaeP+7et0xviH55J5RxhoGxsJuf73qsvvi2ZlMzjH2u7mq8xGP1jgsnUTj+E627z/mSXPoceV8G8Uz7DKvnb6JQyPBL9zqlAr2xuJNr5vsTEytUg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718332223; c=relaxed/simple; bh=qdRWUqit2zt27Rf7I2FXQyMcGNwGWl5gyBtLyWFLXYc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=j82dsg10jbnsmrvRFzHGv7SwvfC0hcQLGRSn4xcnY5SyGEL3WZxrobuvP6GKHfXzYRpsPTPC7hGNTyYlczSdKjTTHdgMTtBNZ5tdlCTTFHpYB+myzVYIFJPsCqaJYCoTTbQcCTsXZXFao3PEQQqXBpLsiKT6E8il9BNrRa/dDLo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=XSGnh9Ys; arc=fail smtp.client-ip=40.107.93.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="XSGnh9Ys" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n+teUa1lsFgw9IndVXCcJaLbWg8TxygQEpEg01R+pc9g9UR7KIgk11sq4m/60W1kTYSMyGAuXGAsEAwmolH138OYcbgO5dBBgMZGOWnfoy3SYwtLglkhSZdzcZxdsfHo9+66+2V7Z6+ahMPMfS6gfUca/5ZzKe352TsYge8Z1/MJZFVbH+kEZgCWMEp3LZnlE43yQi8vQwqQ1W35n2tQN9q4iGQzzd8or4KerC3YJc9N9tx7O6CcG9N3b1HVRrBh0xVIUI3K3LvUNAEM6qwk5HAsg4o9haoNlui+P/RHQswpo2vybIOcL/TqbCLLzqLqGUj2qusu1KmKy9JR8WX22w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=NoWxrNu2/lNGxpSyzZvJOSkpzkLkvc49dciH5tTtUsE=; b=b40th1DDgbcabrufVNcoWz6okaukX1jKL7Ay0NP53djLRcrL6+8SyTjjVW04hnIlQb+i55kN6/Lmx/D7QYmeZcHIluHDeKAkAw+0vcLcoYoIHO+hvVm5yrs3vYlXjPMBHnzHmBk/i/Oz/qsBuevDw8v6dNrHycS360mz0Hg4Pg+0A8rOQdRTM4Mhrakah1hNN8IXVxevBKuwQpK2gH+4LJ7D1wFsQY3ynMEZPTfCXhFOEYtDinT7ZZuKYK8z0pjTpuIwt0azDnWqJbmNLTeVWO/cI3+AkCY4S7eXqWoITXq9bPGgjE4Gz/BuzD6t9F9F7cDYK9dj0u5yWmXhFKPSBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NoWxrNu2/lNGxpSyzZvJOSkpzkLkvc49dciH5tTtUsE=; b=XSGnh9YsaDJBYBx/xfxprChgw5anYIdirbQEtKNaShLdWVG5f9p5FwcSAvbuo53QhA3hS1vRVJeVQSzeqGl53HuQBLpQgVOc2QBHkt30wi8w1RYyO6oPHhUt1+JVRcflisl2BiKNT+WLEUIfy3p/WW+oFn/pj20HMxIzXSKUg6eHljdEksaf8MjjEr6n6HISCjo9Uszg8R28cPFs5hySnLcETD3+dac7X/SJTSmA+t6MsC2MpxcpOt8DLOd13d+ASigQF97TCM/2o/iLgH2RaWuA3moW/bNKXhCgDncIsakZkYqr5u2JN7HhcI2rIZxcnay5/uTTPrnVKa4IO4836g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH0PR12MB7932.namprd12.prod.outlook.com (2603:10b6:510:280::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Fri, 14 Jun 2024 02:30:13 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%4]) with mapi id 15.20.7633.037; Fri, 14 Jun 2024 02:30:13 +0000 From: John Hubbard To: Andrew Morton , Jeff Xu , Shuah Khan Cc: Andrei Vagin , Axel Rasmussen , Christian Brauner , David Hildenbrand , Kees Cook , Kent Overstreet , "Liam R . Howlett" , Muhammad Usama Anjum , Peter Xu , Rich Felker , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML , John Hubbard Subject: [PATCH v2 4/6] selftests/mm: fix vm_util.c build failures: add snapshot of fs.h Date: Thu, 13 Jun 2024 19:30:07 -0700 Message-ID: <20240614023009.221547-5-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614023009.221547-1-jhubbard@nvidia.com> References: <20240614023009.221547-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH0PR12MB7932:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b723ddc-931b-4407-cba1-08dc8c19ebc8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|1800799019|366011|7416009|376009; X-Microsoft-Antispam-Message-Info: 00DwUfb6Cx0kE+iq8+fsxMqckeSp4uwkSI5rQdDahrgh6XipuWh3kPhVbwJGoq7g/5MTLXVDcaf5nP8104H7XMgZPISGjmLEiKrBmRUjsL2yAlECG0jLLXtGST3i+gkcGyQopGomM3WDsS1xS0DuR2wjftjU7c+QgZSf5cAkFbdTPo8w7b0Kz4K6dE4In6loGD01GhdntfDaZ7zrM1I9Rn2Kohwh2fB//nARhiSjbKdfX89vFBue3MGbbUVM6n3fMJ66UrOxZKtax/YgZoe1vRuxfANjNk6aFp203fY6vafz9kmTZKGexHtPppRQCsAj2j7ktKCPhbhHxa9AMFqJc2PHq32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.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230035)(1800799019)(366011)(7416009)(376009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Bd+ApD8ZrIBaQUhXhgPwpe50GSqxJ3BEgxAXR/MlMaKs+sNPO0r38prkE892I22O46gqBDWqIWdzN0c9/EfhN+pUoLqAY45+Lc4zv0NlRfBTVC9k3FglEXUSfwfTHrYGCe3HTQpZibglNq76Ru4FHF853Dkw41G5iVP/Sualug1xle/06wGy6naj1KrKzDzxzVz5zZ1vb+sg6tm0SoJVF/uuPwsLP9onz5UId3GzmhTlT/Bs4hf1SMfudBI2LAC1MZPQndVAVf3L4YV3EEFQz6YATvZ0q8p6+waFOarGfu/bmRfc2fZCD9bl7ehBlJNmuirGNTr31ILJSri1oq2pwXv/cJFBW2zks9duklFB+YMURDqKeDkKTtYk+Cr6iRQA/5NSZxQlwSsaFYIaSWHPejoa2crPrPUEWtf2gtnQH8zp7K7NfwumumF4wFJgLeIjbI8Jf+dhKxCG0fntjSeqM8xKLIms8XW8+YSIxW7eUgHHN5N02RWLTfgqZOtCfDlmXLnkHfmorwb/0XJwQT8yeKkr/vouG0x+YGTGHdO9TFxyoESgYRbndmyl+UYKjD0TxGuVv9LljzcDMmEpXyA2vL3iHPoMI5K8I+sgb4RAMrsMUiahlh1ESzh/hMw2DZBhaqhNLtOT4NllDRO3YSoTc5axteNQoYBebvZteeNJmeHgD15sGhm18nB8jacGLi1hmUZQ/6bvWNFmPreRJ+RWeh4OTeThgN3KBwuo020LjvAmDYQ/A8kXsRPrGOHGXQ2FwzS1m8KabXxV/g35Xx2Or0K4qimp3BuwBikQ/mWe4VfE31tx4MGx2QtTKngsfMRI6vO7twtmziyOD4xo5J5kLiy+rZlZndojgFt0uDGsRW65NCzyQhrcicyCW1BNJP/HS6u3UMZfcjhx6J5zXeQI5MUCCTUrNrufMf6B3DH1PIhGdLK8zGx1zx6hAVdUkcxuBdPf+ETmPgTeD4ij4BpvkpHENLPr9an991zapcLge9Iu/ZN6mNv8zWPJaN6FFUgX7J1Lq9Zlmw1hwictFPLpeuNw1oy2vBj9nJ2xyA7UcSRYMOfIImBSYTLpkUg8dTmdJI7i68QyLYL/h8JQIMLHxbQ/Pasnws01ZmrAjmW77JbDc3dumQGYyymg7ehFQW1clGU3iLG7HAewef4StOURabaqPWlzWGxp4HlEJNmzGFmQmzbxk1z0TEVqdtgjyvW+izpuipJ/IWU+CEOuc8cbodgLDMWjFbN8g6YDRdGV1cftGHUMtU5uMP4Eg6cNnT3LIjnT10Y3wzSIveT/jl6cnLoNkLTDNcdypKgnF1/A/k5RqpphCMogRmABGMNF9Hd0CBTbLGhBumRXPbLmcncxbFGcNlPStiqBu2hP3aV9zKlsR4pVFJAbAw0y+iKwzcEIQfXZV/sotklwYtEstbZIukbeVsaGvpXRiq+G5+PnAP10zNHc0P3O9KDxSIfjnDOO8qhNb0OvhmUNNq9t2olZsHLlvn+S88EmuPA2Pf4Cy9BVk5X+Xcw+OO7cwcA43OtfT8QKX+BdtMwTuN/OpQ9ia7jknX+SnBFbcSfJtIhpOYIRvAHgwVysl8t4wSO7eLwP X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b723ddc-931b-4407-cba1-08dc8c19ebc8 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 02:30:13.8429 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5crfw4ZB2CNsc4vx3Wxkcu2HJqM54pOPhbaAhUzqH+VlwkiurgEP35vbQeUG8nkoN2D5OR+PTV9lKI34XHh0KA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7932 On Ubuntu 23.04, on a clean git tree, the selftests/mm build fails due 10 or 20 missing items, all of which are found in fs.h, which is created via "make headers". However, as per [1], the idea is to stop requiring "make headers", and instead, take a snapshot of the files and check them in. Here are a few of the build errors: vm_util.c:34:21: error: variable has incomplete type 'struct pm_scan_arg' struct pm_scan_arg arg; ... vm_util.c:45:28: error: use of undeclared identifier 'PAGE_IS_WPALLOWED' ... vm_util.c:55:21: error: variable has incomplete type 'struct page_region' ... vm_util.c:105:20: error: use of undeclared identifier 'PAGE_IS_SOFT_DIRTY' To fix this, add fs.h, taken from a snapshot of ./usr/include/linux/fs.h after running "make headers". [1] commit e076eaca5906 ("selftests: break the dependency upon local header files") Cc: David Hildenbrand Signed-off-by: John Hubbard Acked-by: David Hildenbrand --- tools/include/uapi/linux/fs.h | 392 ++++++++++++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 tools/include/uapi/linux/fs.h diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h new file mode 100644 index 000000000000..ca9d754bae04 --- /dev/null +++ b/tools/include/uapi/linux/fs.h @@ -0,0 +1,392 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _LINUX_FS_H +#define _LINUX_FS_H + +/* + * This file has definitions for some important file table structures + * and constants and structures used by various generic file system + * ioctl's. Please do not make any changes in this file before + * sending patches for review to linux-fsdevel@vger.kernel.org and + * linux-api@vger.kernel.org. + */ + +#include +#include +#include +#include + +/* Use of MS_* flags within the kernel is restricted to core mount(2) code. */ +#include + +/* + * It's silly to have NR_OPEN bigger than NR_FILE, but you can change + * the file limit at runtime and only root can increase the per-process + * nr_file rlimit, so it's safe to set up a ridiculously high absolute + * upper limit on files-per-process. + * + * Some programs (notably those using select()) may have to be + * recompiled to take full advantage of the new limits.. + */ + +/* Fixed constants first: */ +#undef NR_OPEN +#define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */ +#define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */ + +#define BLOCK_SIZE_BITS 10 +#define BLOCK_SIZE (1<