From mboxrd@z Thu Jan 1 00:00:00 1970 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 EE469E77188 for ; Tue, 14 Jan 2025 18:19:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 787B9280017; Tue, 14 Jan 2025 13:19:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7100D28000F; Tue, 14 Jan 2025 13:19:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 514B8280017; Tue, 14 Jan 2025 13:19:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2A68128000F for ; Tue, 14 Jan 2025 13:19:56 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D909FA0C5A for ; Tue, 14 Jan 2025 18:19:55 +0000 (UTC) X-FDA: 83006871150.22.B1ECE92 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf07.hostedemail.com (Postfix) with ESMTP id 64D8F40014 for ; Tue, 14 Jan 2025 18:19:52 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=S4u14Mcw; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=U5ZyW9ib; spf=pass (imf07.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.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=1736878792; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3ZsyZoNrqrDWTYVpNXC5UOQC5Md/5caVIlUCamPk/s4=; b=yIlGzONHpec8SnSyr8mgW1qiFv6C2ESOqpLyTe2/Rowbpyt7NMAAYks7nm2G5c9D2O9G6B wOxf1qMF5MGESJzeJijShDy8YnLmGUjO3y6L2yZ7GJhHIyp8J6mjrDiUD+XUN3GAOLOxpo JYhpgW/QgYTPn7mnVPic7hNKwVVkwNU= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=S4u14Mcw; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=U5ZyW9ib; spf=pass (imf07.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.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=1736878792; a=rsa-sha256; cv=pass; b=P6/6Cyf9GLjK8klg+6HWes9weSGmYew9yXxdD9T/jp8P/KIhfRzaVo5uNHjufu/BUjkO6F wE2RNIpCUpYtbfBF7VPOy3/hH5cedl91ywNW8TbbC7NPICIxsniqPa6dDVlvkYzYe2gBU4 vL+3UAc87SGTKs6dHPms1WRBFSvQCgs= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 50EIHa18031894; Tue, 14 Jan 2025 18:19:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=corp-2023-11-20; bh=3ZsyZoNrqrDWTYVpNX C5UOQC5Md/5caVIlUCamPk/s4=; b=S4u14McwuSa7BwgOZr2fkCK+jZSo0phhUE l17lOL5SuNbYfE1RZuXaMN5YBrmog/2N1SH5Fm/h5XRGFzbOCRi+VsSEMZpOuddn /xHg9B3rL/UmRc1ofaxqHpCpIDBnDccf5dWASo9D51OXUaO89bGnqLyCe6p49NAE 16XHr/M90FckSGW58SAHiez4yuCSygoVMT50PQ5+JRE0ZmRF+tHFwpZJ9V571hvs 7E1IJ9O0VPjLl/S54OJvZZK5ohbzgKJKeK0Ls0YrDCWrO9nm16UPy/v2ZwQl67FJ Cb6LGQUMTnx8KYbC2Z+n2hSffhhr9NxfMY7zpKsbr69G1H4X29Ew== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 443g8sebse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jan 2025 18:19:40 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50EHPrIw037154; Tue, 14 Jan 2025 18:19:39 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2046.outbound.protection.outlook.com [104.47.74.46]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 443f390g7f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jan 2025 18:19:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PAzKW3dge/TpWIOdwb+BBaHcrbSUpBsQBgc/XvLK+d67CZoy+OWaGE0epbBWQaj5GOaKk+zfU1C7D9+wfUIstbKHwUueH9Fehz2YpYPc+IH2w7QRrNdLEqT0YvzVnnxpkI9vFVGQNCQYWoQQCyN/PyMWK+uJFiEVnzmB9a8moH5/N99RjcQpRuDqcOViDVkNsgUXpde+/OaHYwIp0BafxW2CCkIIrHDkC7cIMiVo+P2LFDAQiUpYtLbXdO5I3VGZUbY5bRLYEMf+z/lhbaUveYD44ApGng1ltR5zO5QdcNUhZFU/6N+/BDIy7tooQkSwC0C7iCllghxenKC5rOLG8g== 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=3ZsyZoNrqrDWTYVpNXC5UOQC5Md/5caVIlUCamPk/s4=; b=tvs1fuTZxGUIhDpDDaM88XVFUIyOnfaiPoUAHdCjSZYO+2M4T1IyAaSiNRUgc7OP1ReIIx7VL/19trPuLUqjku992/+yptML8hyc5r8bxlPPRq1nZ+7cdbDziy9xXJlc7+ZN5wFPC8flzv27K/k57yMx26pKt9m5+32L7wGGQwdNR2UsAbVQjpDWJrnhXEbiqhb/sxndRGtYCwRp/RiTHuqyfW39mGfx3tHf0DnrFJs5vdanSpzGvHAz7uNsacMi1a5GiRtV77jteu7evbAkYeurs7Qf8AQIkTnObkcTAVMO3MBWwrrYsvCSTuCmZ1eg6RZjVaTZphk3Gtu6UzBEoQ== 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=3ZsyZoNrqrDWTYVpNXC5UOQC5Md/5caVIlUCamPk/s4=; b=U5ZyW9ibOdVI2bYySX6+9cXsB7/KZM98I+WnE7HEDITWayXyAJJY+upNLSbDQyUavwWOs5cMb/nFOpHZRiCBM15MsWOYODm8N1VRtgxDoioAVxwaS/WC7qNuiqWkacQ6LTbTCUNcL78xU/JfhF7DC1HiMt4ad2LCZ3NnCi1nE/g= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by DM4PR10MB5991.namprd10.prod.outlook.com (2603:10b6:8:b0::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Tue, 14 Jan 2025 18:19:36 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%4]) with mapi id 15.20.8335.017; Tue, 14 Jan 2025 18:19:35 +0000 Date: Tue, 14 Jan 2025 18:19:32 +0000 From: Lorenzo Stoakes To: Yang Shi Cc: arnd@arndb.de, gregkh@linuxfoundation.org, Liam.Howlett@oracle.com, vbabka@suse.cz, jannh@google.com, willy@infradead.org, liushixin2@huawei.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] /dev/zero: make private mapping full anonymous mapping Message-ID: <10f5cb31-e9fa-4574-b36d-0e685fec5cda@lucifer.local> References: <20250113223033.4054534-1-yang@os.amperecomputing.com> <2dda50aa-e4a1-4664-b8fa-56ba975db329@lucifer.local> <65691afc-615a-4716-8a2e-1f43bc65111c@os.amperecomputing.com> <3fdcd6a5-27fe-411b-923c-b7410e4cbda9@lucifer.local> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3fdcd6a5-27fe-411b-923c-b7410e4cbda9@lucifer.local> X-ClientProxiedBy: LO0P265CA0005.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:355::10) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|DM4PR10MB5991:EE_ X-MS-Office365-Filtering-Correlation-Id: 15641196-4d0f-4c56-fc19-08dd34c7ffa4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tj05AABypt7O54GytSs1P6jXlshnOc2e/hKCmx56hldviTYg/Y3B6Ngr4vyK?= =?us-ascii?Q?hZeC9t58FnRed8WOLYrDPssPV0echgsNxhCSRcAmji8Nt8BB1QCa6BbGXnfl?= =?us-ascii?Q?hHq54ClJVOiPupAiCeD6D4nb4+W+Aw64NLko9Pn87F914tuuM1Hvxs3If/Id?= =?us-ascii?Q?rhBOoF3Q3iRxP9XgDjQJtDp3Vu9Uo0bU57Jwm82dcIkMaWgoI5zbmnHasjMV?= =?us-ascii?Q?DPOosZprEETyYABojb4/a4C4UiBaCYZwJk4OQxjJR8P8vM75jYe1QVcJDRsN?= =?us-ascii?Q?LF61duxJW7R92EzkEjs6ubX6Z6+D712I44FnaShQWnsS7+UMOEJlOwDB6rvE?= =?us-ascii?Q?BtimO+3CsYjHnwzrHCpFoAUtuVHbOXILKj77f2FlvuTZq21k56okn8np1f58?= =?us-ascii?Q?LP0IY8DHqmlPYD/B1XpWMXbYmBkL/r5zIGWZpCmxeFUfDbektJ57OMpOTshO?= =?us-ascii?Q?y0Un7pJzk2QHWybYhqsvJN2jHGrrblDfqXTPsvTPdT6RGUVuv/uXVyBWC5yd?= =?us-ascii?Q?cYZg37hG/PpHAg2FivgsgpLL+QkyaTavzBupxr+jGOSzelP1q9K0dBi7ZT9C?= =?us-ascii?Q?htFXtiLs3m/iMBrVZKM3CIGREcSbhSkOfOa83UQ9noXV1N0QJ7bjBhzO8coN?= =?us-ascii?Q?TDRZoC3qosOyzfEbQ1bAQFnRZXIdgcXUeDB4Tz+ksbm0nft6PIDGS3VfgaB5?= =?us-ascii?Q?QazzN4os+NlWGOcDC0XOZyZRGuZCXmS4MLyussI1wUQWoIy1JlhlJGqvuBHl?= =?us-ascii?Q?gGEsppTmyhwlt/DzLrgytVnghB1kJQam8Kbdqt+bHXUUDd9SNS6bu7/i3U7Q?= =?us-ascii?Q?z7xdsuyTpcIOZQ0wjvA1YflnW2UVt0iuDYiMmyz8I2IovTiaSdQuA+7X5GJk?= =?us-ascii?Q?HEmALvOpLkV68d/s6t8DLVzy4WNNaF7MqOyhOw6iwiSrnYjAjH45PllX9yuF?= =?us-ascii?Q?oOhV5w/erAVRTj42Fb+JHbk/eq7+4vg9ud3i7pNowgxii7lEZidxMji3xdpn?= =?us-ascii?Q?dVRgJdAh9JAQSJng4oDSGiBCC7LCQfRMRgmhK8yuRUN31n02tfcZWHQwlZlx?= =?us-ascii?Q?FIasA6Dj03OZezEHoINQIt98I+1CFl+WKWJ6mbvGwSXVrLp0kH9GXJnup5FU?= =?us-ascii?Q?pJiJr0OSw0NX6FzCVSeD+z3a0m71yEBbWBTwgDCulHjDkPc31E629whmMFft?= =?us-ascii?Q?jRGczaR5YeG21Q5KXoRId0OxIQACdTWRe2g9lMubMaxp+ROo6hVZipZV5Z3s?= =?us-ascii?Q?3rMymdGikm7Td7CDW7mL8vNHjpIUhl0qufl27HhHZCQSIQ3PhF6WMN4XV5zM?= =?us-ascii?Q?nZAOIwCopRGDsZZHREdCcEohXOvSDfEpsRh8BAvtCKVPeOrjIyGYcylEmEYw?= =?us-ascii?Q?VXR/gADSyUL+sSThjE1t+vuYAmZl?= 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)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UlRp+qhRawid4cbqkKelHe6bZmNzrFEZsKfpCc2P0wLfV3KeV+DS7/bepi8f?= =?us-ascii?Q?UlJj013XmXuafBBsNDeFlrvOE2N3d0SKQehsehgun3f8EZN7FKeBBZbkvSBP?= =?us-ascii?Q?Ce+P8ga1J6R+ToRQnT9Nd1eJgPVLZVjX1mtbGe38sBqOdhnt/cH8yUVeI1ZM?= =?us-ascii?Q?zCcVoWHhvLRC4AIMBvKqsGHc8L0QrPNZLA5CCT4dAi/R9/afwpCllM+8q+n7?= =?us-ascii?Q?G0sE0eJG9bsQJylWIbNO0wF7UmzqK2YQu24JyrvVv962Gr0vPIrDwKWubDfl?= =?us-ascii?Q?earms6WTXAh1Av3DfLWrufGi3iJjC0F1w2l+AeAdDhdJsC5I1snIEZlSj+vc?= =?us-ascii?Q?KEcBLVsFMopiH0Z7dtqtzqjSCVRwSOVuk+2nA8yYVAREMkziIkBj97ZHPx6d?= =?us-ascii?Q?NepChOZCMJBQ5bOChtt/I+JmAQbgEyOUxskGH9T8exmahKtZW00jXnu9EJQs?= =?us-ascii?Q?hAw2JwEKEJITcuJlw6Y447qyNOdPx6VwUFKknVPtyHstcyvLwUhIbKgpMkXg?= =?us-ascii?Q?Q7xx56dlf1pgR3xKmp0r+s8SIILhbChzNf+5UXH5MVnvUBhqNrYoJOkM3oY/?= =?us-ascii?Q?bKcxJLrVTZOtW4Vs5EZZhzEOHtU2DPyj0QgFiSvN8+Z85ZUEI8dLUR+vtn4r?= =?us-ascii?Q?6ai53np+S/5tFImcVIpkJx3S+1l1loQJ9grfu/l2OwCYcZQnZXkIC4jG+Eb4?= =?us-ascii?Q?/uS9mHGKi+BzU6NPnFvDL3PBBTOGo4hP9ij4JnAvXEluGXTtcCixHUFGXFy1?= =?us-ascii?Q?SeElwXYPJ2s6j6S6ELAc+qLMZSoV4fhQ4tJTYfE50qfWEBxWDyaOhPvom2rZ?= =?us-ascii?Q?JDv/bKHGuFYnZE5JamrVEaJ06JQDpyVTVS+vyX9YKepv0DyuOHRymVeULTsk?= =?us-ascii?Q?4rUy29Mjcnwb18nRg5HcxzrC46m3G1vr417M16HOsNJJyY1qyHc/9Mqc66Yb?= =?us-ascii?Q?F5Lm1N9DRoCd3oCWa6SsxUFzIJfgp1yeoZfFOhjMrjt3L/65B5EpkfdyRAiX?= =?us-ascii?Q?s9kTZUMRmiXdRsg/NHI/+fItvC1OX3NhyymsNPORD/yI7L/7rqZoBdU68xjq?= =?us-ascii?Q?lvPVoOOGvo41sNB0f4fVST4uQW5GJOdnD8bSXdbUwU2sbFUESMBr22n1wIih?= =?us-ascii?Q?XNIZHBw9dHKIhN83yw0jyv3RUDFILrhv39RuMn+p0bBw5sBBnTDCtGzJKtEH?= =?us-ascii?Q?K8qIsBJmCkUaCy/VEiGh1aJz7nOi/hvDa1cBDmv1htUfDbNFDLsoOH9/EKgu?= =?us-ascii?Q?gCMaW6Di2V9EKDT4C5qtZBS0mD6H0xM9e5P69hkYOSy8YDm3/lAXNOaA41gr?= =?us-ascii?Q?70z8ekDTrw9NwPBQ/pds1tugeyDn3Nwf9dqS+wr4nGsb2n3/b1u5cB/pgd+g?= =?us-ascii?Q?hpsLlxbx3kwI1WskA0/eRiMaX04jXUSGSGjnunrkoJIfJeon8KGK9sbMna5E?= =?us-ascii?Q?etj4l9hYvyT9QdFVTcriNi1kt/4GmbFJ/LfhVCHfdgDYp5VYjklMt/HkcoQF?= =?us-ascii?Q?DBe2OyTef7pvyXfz9PJJKwMzb2epIBanRg1ezfufMOpJuN8KUcnEH/ql4kTf?= =?us-ascii?Q?AxQyUaJVUEscPPsKpyzcjrsQTNlVe+iNYJVZSND7k3M/kWawuoCdQZUCahi0?= =?us-ascii?Q?pA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: sCSWtBA3cPY2wcovEOk0hFVP1U59198Pr5xi1Tbz0zY62GrzB4IUlEM+tiIjuCKf/TumjIszx7zCFiGBu+iGZr1aM/fjYtywowLWZ76aJBrl7XUJkm3gDlycgTiSPY0UEqt06bfWkBiO9R4JKzhjRvWFIch1dlZBV2mX/3hfHUMv/27IV4Lk9RibCW0+vWOyNqVX/2q9AqXfVlKqnGEe/fLvoGbFshM8tl35xsi9aRAsNriP2DOPetDVqTDJoeFKcqxLE5Lwn4LnZMMmgU/o+ieeMywI9UjKuDTCwdhs6G7POeMHWTu+ZQ4gNKKIBt7l4pjYud3Z9SekDfCQvBm76cnqEAbxvlpqeh57UStsmmu+4jSEbZPzI+6AbeE18R7FdA7SzizmIsZ2wi9uw8ihaQX3wjm6OTeSRbTpT7h6VQmj18X1OmXmrRVkITxVGK1JAwdcn6wy1YFcIgKn8A1ERnQdNv2bKcx3ZPntok5LNubtTxB7mnjGCnRMLWOZqo0+IuG9ldo+R/Eqc6AmgVydXYbMpyks9gtKDWcXXGEsRNaKM57BoC0ABvU/J+gtrOGSFE8T1hObqaxjtIILU1eOeL2KzSGgeV9hwGvatY6YgWM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15641196-4d0f-4c56-fc19-08dd34c7ffa4 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2025 18:19:35.1244 (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: 2UjA+U1m3v8fzreCYVVXVmhLSHLUSeptKt6XvDzkC6C/EUDVpxPSFVWlYsPLB1k6ZsCQkKNw82qnlF8iBIVKxN0NiSLEUqbPNM5CcUMi6q8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB5991 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-01-14_06,2025-01-13_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501140139 X-Proofpoint-GUID: PH6TtkRkK7EMfW08qqfvy7eshlwiRhlI X-Proofpoint-ORIG-GUID: PH6TtkRkK7EMfW08qqfvy7eshlwiRhlI X-Rspamd-Server: rspam05 X-Stat-Signature: 3spzstwdjyxytkdyhjkzjnf35mib6nja X-Rspamd-Queue-Id: 64D8F40014 X-Rspam-User: X-HE-Tag: 1736878792-345492 X-HE-Meta: U2FsdGVkX1+o5MCWDBrekvU8d2rW3SO+haufzqCyZit77PeYvrqjIJRgcQGRhIz1WlMMass7VwwW/XbTatOl/KCw9jOx5L2MrKeDfiMRiZqJoxGuJWmatcR9u5yHSRhkoW/EZwoW8aEvyEauq9orx2NJNkI7soQmSXaqvnbZusoNzMTcJteXz0sD5jlu5f2PY2y5oUiWZFpJnq3IhxX/4x+rLnzSFQ/0uhnZ+ThZMhX7ADxxduxro5OaTduH/I1YnG/y0e6vZJgKr8RwiJu2Ffl9/rW7hIlCV3HU2BgWismdERzgo6/0WzRQ2lF8Gs5sCwhEy4zt4m7Ue2rG/pXZeudz1vQNLIY8QBOs1mvVs8BGe0UUZn+ondu+dOdLOLlmDkaaE1pioZw7/NWgMKW0b7weurf8lMz/NR0sAytC2JVZmfpTggxmYkE1m2qiEkSaDuNPRJAf3LnJ5TJfo5bfDapJ3i1dEveZybQBRUfUV8afm0xXpojqFRffiwz6XSYymnc1gsyEO3yJKmY6nK2j2aWHYiQZ2sT9UPL63PQNOkVu5S2d8Eyzfeh/A653awoXsau2HBCO1CqfiqiZ3t0nG2kSsd6oWUHEap4/eHxw+qSAbH2UYRt6tzvXWOegvYFrcZ52CfKwBLtNLphCBD5EQvpjXXpi2OVCPRYpVIw8auB4zFKVYDHY50DaXsQiek4noq8MC5Jcn/Lp7nvnEJ2+ckAdRAIznTRLqbKaDHWFMN7oICGqFnznfiGz1Ir4yodKAufpUOazoGvCImTGuDW5KZbVhWaWqDOIulWkf4fydnDLK6WCkK4XRsMrAwjU8YoweUdJbBkNNnKmKnBl5MZQ7gqAjfVi2ueU5OmAeKeThRFQJX0bZlb2Un3hlC3gb/FF2bc3VaokAwK6dy2mL72EZq6N1MCwBpJ8Gk2koJeEY9g3nGS2WvIZktXm54FEXg8xMFyix1UHT5/0UtbRkFL CaE/aCOS ghwFJgruTctCpKHHkakYp7tnKut+dbUiZE5oTFt2dqyfcw+7RHg0l0AbET6vyw+Zz0o0iDd5epEKIfOOAeCkfMqwRgbbp1yYaOQLRSRoAFVbi1/N9FNseMkF0j9Hx5ogs/v8201jK33XNvr1HyMH1vFRZPMpTwsZ1INy864cAIq9RLGFYWZp6STR7wFHXnot+77K8sQ7FFCnHqfOoo+TfD+6bSByIo5pZ0epD43qQF1G74BLxqjls05cYKIkNq3gkNwr4a04nklsHhpV8O2BLRwD+qMMOIXMQoeoYSg3Bs+iejaCJQCgJjy4ZDYJMlt7E9a3uPLWpgidKbxIjt4MPq1aI9Q3BXtaTd3OBc86h9okfbOvzGQry10ojXavW2QGtlHEHC9qxexulrtp1kprBJBv+SBHJk/kfKsY5nuCQM9N2dvUals8cdMJ+WFeGlx6aUzT+T2LWH4Z1IQ7wSGDjytQfJ1xyYe3zN5Gz3ZUBiLB4NobBAOjInGIMjPm7maNmKZL33CNkC6aEY4hDFLf2eVzBIvZ4WAZC5iTFNuH7nE9d0JYB2ESc0RfTScB2iC3iESEtosIzCR4vMHFilAW8u7AFtnHl+a0MVDZvG//avcaD+zdIZNwhnRFby0ldfAMEYwkteVE/y721N4ZaVV1tQ/b5vQ== 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: On Tue, Jan 14, 2025 at 06:14:57PM +0000, Lorenzo Stoakes wrote: > This is getting into realms of discussion so to risk sounding rude - to be > clear - NACK. > > The user-visible change to /proc/$pid/[s]maps kills this patch dead. This > is regardless of any other discussed issue. > > But more importantly, I hadn't realise mmap_zero() was on the .mmap() > callback (sorry my mistake) - you're simply not permitted to change > vm_pgoff and vm_file fields here, the mapping logic doesn't expect it, and > it's broken. I see shmem_zero_page() does change vma->vm_page, this is broken... ugh. I will audit this code (and have a look through _all_ mmap() callbacks I guess). Duly added to TODO. But definitely can't have _another_ case of doing this. > > To me the alternative would be to have a custom fault handler that hands > back the zero page, but I"m not sure that's workable, you'd have to install > a special mapping etc. and huge pages are weird and... > > I do appreciate you raising this especially as I was blissfully unaware, > but I don't see how this patch can possibly work, sorry :( > > On Tue, Jan 14, 2025 at 08:53:01AM -0800, Yang Shi wrote: > > > > > > > > On 1/14/25 4:05 AM, Lorenzo Stoakes wrote: > > > + Willy for the fs/weirdness elements of this. > > > > > > On Mon, Jan 13, 2025 at 02:30:33PM -0800, Yang Shi wrote: > > > > When creating private mapping for /dev/zero, the driver makes it an > > > > anonymous mapping by calling set_vma_anonymous(). But it just sets > > > > vm_ops to NULL, vm_file is still valid and vm_pgoff is also file offset. > > > Hm yikes. > > > > > > > This is a special case and the VMA doesn't look like either anonymous VMA > > > > or file VMA. It confused other kernel subsystem, for example, khugepaged [1]. > > > > > > > > It seems pointless to keep such special case. Making private /dev/zero > > > > mapping a full anonymous mapping doesn't change the semantic of > > > > /dev/zero either. > > > My concern is that ostensibly there _is_ a file right? Are we certain that by > > > not setting this we are not breaking something somewhere else? > > > > > > Are we not creating a sort of other type of 'non-such-beast' here? > > > > But the file is /dev/zero. I don't see this could break the semantic of > > /dev/zero. The shared mapping of /dev/zero is not affected by this change, > > kernel already treated private mapping of /dev/zero as anonymous mapping, > > but with some weird settings in VMA. When reading the mapping, it returns 0 > > with zero page, when writing the mapping, a new anonymous folio is > > allocated. > > You're creating a new concept of an anon but not anon but also now with > anon vm_pgoff and missing vm_file even though it does reference a file > and... yeah. > > This is not usual :) > > > > > > > > > I mean already setting it anon and setting vm_file non-NULL is really strange. > > > > > > > The user visible effect is the mapping entry shown in /proc//smaps > > > > and /proc//maps. > > > > > > > > Before the change: > > > > ffffb7190000-ffffb7590000 rw-p 00001000 00:06 8 /dev/zero > > > > > > > > After the change: > > > > ffffb6130000-ffffb6530000 rw-p 00000000 00:00 0 > > > > > > > Yeah this seems like it might break somebody to be honest, it's really > > > really really strange to map a file then for it not to be mapped. > > > > Yes, it is possible if someone really care whether the anonymous-like > > mapping is mapped by /dev/zero or just created by malloc(). But I don't know > > who really do... > > > > > > > > But it's possibly EVEN WEIRDER to map a file and for it to seem mapped as a > > > file but for it to be marked anonymous. > > > > > > God what a mess. > > > > > > > [1]: https://lore.kernel.org/linux-mm/20250111034511.2223353-1-liushixin2@huawei.com/ > > > I kind of hate that we have to mitigate like this for a case that should > > > never ever happen so I'm inclined towards your solution but a lot more > > > inclined towards us totally rethinking this. > > > > > > Do we _have_ to make this anonymous?? Why can't we just reference the zero > > > page as if it were in the page cache (Willy - feel free to correct naive > > > misapprehension here). > > > > TBH, I don't see why page cache has to be involved. When reading, 0 is > > returned by zero page. When writing a CoW is triggered if page cache is > > involved, but the content of the page cache should be just 0, so we copy 0 > > to the new folio then write to it. It doesn't make too much sense. I think > > this is why private /dev/zero mapping is treated as anonymous mapping in the > > first place. > > I'm obviously not suggesting allocating a bunch of extra folios, I was > thinking there would be some means of handing back the actual zero > page. But I am not sure this is workable. > > > > > > > > > > Signed-off-by: Yang Shi > > > > --- > > > > drivers/char/mem.c | 4 ++++ > > > > 1 file changed, 4 insertions(+) > > > > > > > > diff --git a/drivers/char/mem.c b/drivers/char/mem.c > > > > index 169eed162a7f..dae113f7fc1b 100644 > > > > --- a/drivers/char/mem.c > > > > +++ b/drivers/char/mem.c > > > > @@ -527,6 +527,10 @@ static int mmap_zero(struct file *file, struct vm_area_struct *vma) > > > > if (vma->vm_flags & VM_SHARED) > > > > return shmem_zero_setup(vma); > > > > vma_set_anonymous(vma); > > > > + fput(vma->vm_file); > > > > + vma->vm_file = NULL; > > > > + vma->vm_pgoff = vma->vm_start >> PAGE_SHIFT; > > This is just not permitted. We maintain mmap state which contains the file > and pgoff state which gets threaded through the mapping operation, and > simply do not expect you to change these fields. > > In future we will assert on this or preferably, restrict users to only > changing VMA flags, the private field and vm_ops. > > > > Hmm, this might have been mremap()'d _potentially_ though? And then now > > > this will be wrong? But then we'd have no way of tracking it correctly... > > > > I'm not quite familiar with the subtle details and corner cases of > > meremap(). But mmap_zero() should be called by mmap(), so the VMA has not > > been visible to user yet at this point IIUC. How come mremap() could move > > it? > > Ah OK, in that case fine on that front. > > But you are not permitted to touch this field (we need to enforce this...) > > > > > > > > > I've not checked the function but do we mark this as a special mapping of > > > some kind? > > > > > > > + > > > > return 0; > > > > } > > > > > > > > -- > > > > 2.47.0 > > > > > >