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 E3406D30019 for ; Fri, 18 Oct 2024 16:18:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E5206B008C; Fri, 18 Oct 2024 12:18:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 694016B0092; Fri, 18 Oct 2024 12:18:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E7C86B0093; Fri, 18 Oct 2024 12:18:31 -0400 (EDT) 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 2A0CB6B008C for ; Fri, 18 Oct 2024 12:18:31 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 81AE9A1A4B for ; Fri, 18 Oct 2024 16:18:08 +0000 (UTC) X-FDA: 82687230696.29.A50557E Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf17.hostedemail.com (Postfix) with ESMTP id B344C40004 for ; Fri, 18 Oct 2024 16:18:18 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="MI8kY/VU"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CLIYt5fm; spf=pass (imf17.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=1729268233; 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=RcEz8PXC4wRAg4GbNHNdkMfIhFeBaYGb4VDKEdC1/0c=; b=bzig866Ie+Yj8bdae/Bv2AOG19C0mesL7liWoReHur4Nw/ysYMMzrdxnLgIUo0fF1nURZp QruP8Lect+4QHafShvDj9pj9VvJWvQvKVGU6lSw8wmyHbZWVuA9gy9ipwkei0l/mOC985Z o60fXqpAV1ivIrG7CdFN8PgDVwfcYwc= ARC-Authentication-Results: i=2; imf17.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="MI8kY/VU"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CLIYt5fm; spf=pass (imf17.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=1729268233; a=rsa-sha256; cv=pass; b=JulCphXTxWWPHspfIcFTQNTkQ6jhoasKogZHO1EDJVQeN2qhJiXLpYIK/XwiUJaWUy/k0U x7Ms7mjDIOyTmniID+Dy1ApfP/kZ6wYUFj6ObrjhN6TBX0ak3CCXvYiIxsE20Xhptfm5pW Eyx5YG5WiucDZWjYlhpmTFr0rXT4b7I= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49IEBggq019370; Fri, 18 Oct 2024 16:18:05 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=RcEz8PXC4wRAg4GbNH NdkMfIhFeBaYGb4VDKEdC1/0c=; b=MI8kY/VUWvtEOpPOESvrW4foG3XNQNABMi uvXWoS0sR3L6izyDrIWJcmOYMhlazMbQbsza6rQrHV4hDau2e+NjVeB/of4mE6ct BjoMEMePHB824TmZ6/12LOOifomKGHBfHjOsRHG8YcB3lP6Dw2tB+avW0s4LqCvK q6bCaV8hWhKa05zEbAL+Ygu70/G+GB3+r6X3Iq5MMg9giQzwGT6CockWvUjbESt6 kfDe4/iANj3WFza9h/6bW7roBeycaWnVqgubzltKizbbL3nNXpctS8WMmcQTTr55 ur2YHp+R5E7hknmIcHstfnyRCUVq2ZZPr0VsVWBAAtoJMrGY6PhA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 427fhcrtw4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Oct 2024 16:18:04 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 49IFn2wm026287; Fri, 18 Oct 2024 16:18:03 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 427fjbsqb1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Oct 2024 16:18:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fWtexNB7S1hjW7WTUxJ3wk7KP9CPjLml/dkA+UjL3Z8NRjrKI4z8v6v+Cpuk3CrWX9qQNa6L3vEQV6R8jGPFAvCjKcH2x6P1XuMpEQItg1B2o5NCImkPfR5yF1So7oQQDOLLmRnp1268fnC/9QR6RvVs2vqntc4ykGM9LiGzmjd6C8YT/u+vntk4TIuKrJEuEVkhsxux7tQEeoaw7xHWRpPZRB5gm4Qpklj0eOnArDDNzVMn8jda5xnIvpaK24TxHGFiW57fBJrNQzKHigkUVNmVpc9XES2CsQxyfKV9QmaXQpTRsvHZawymAtGCdWl7/ZZxPNouZwJLcIqZc4AbRQ== 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=RcEz8PXC4wRAg4GbNHNdkMfIhFeBaYGb4VDKEdC1/0c=; b=M1RPyKX9y6tx9P4/FhhwjypGRavaQhyIdmMxvr58xQdr7QOQfSkebNasROL+eAgbsOS+Yn0MuEuABmAL7A1qiH+q2r8cMUlt47eHZBBmMZvA6z2wx6rrmypWCPV/eUfKfGCPmWaSRz8MyBh0d6lu+V/bzgCD9KnLRFmR4aernMpDCpxalkXwv1JzBySa2xDsmtYlf/9tmvHcng6RUIWQJsCzBUkQA1aBFH8o5czGyF1P0/HW6ICDhYmr5zMs8jr0sz7egacIdgMzUjTd51Z006jDRSuhN7rLCl11NsyRKCCrjZlUN0kaXhFNy3iIfuAHgILDEG0HhEMo9FxldIHwTQ== 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=RcEz8PXC4wRAg4GbNHNdkMfIhFeBaYGb4VDKEdC1/0c=; b=CLIYt5fmomsjJENmIO5GsfilsNOyzV/fmotKGBOQx6xIKO8tFG8Y1ztzGN945rQ38V8z0AgGYNto3u1NxxdXvfx6pdiw4VeukeJo0Qy5cnGhvr7R+l/XOVs1Yd5BAaFyXWdnmPLoMvMVD/H8w+h+wBuhQ6vVSu/7r7QP6j3jYSo= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by PH0PR10MB5895.namprd10.prod.outlook.com (2603:10b6:510:14c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23; Fri, 18 Oct 2024 16:18:00 +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.8069.016; Fri, 18 Oct 2024 16:18:00 +0000 Date: Fri, 18 Oct 2024 17:17:56 +0100 From: Lorenzo Stoakes To: Vlastimil Babka Cc: Andrew Morton , Suren Baghdasaryan , "Liam R . Howlett" , Matthew Wilcox , "Paul E . McKenney" , Jann Horn , David Hildenbrand , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E . J . Bottomley" , Helge Deller , Chris Zankel , Max Filippov , Arnd Bergmann , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-arch@vger.kernel.org, Shuah Khan , Christian Brauner , linux-kselftest@vger.kernel.org, Sidhartha Kumar , Jeff Xu , Christoph Hellwig , Linux API Subject: Re: [PATCH 0/4] implement lightweight guard pages Message-ID: <4b5382fd-e553-4fef-a7c7-a2d3130b948d@lucifer.local> References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO2P265CA0303.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a5::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_|PH0PR10MB5895:EE_ X-MS-Office365-Filtering-Correlation-Id: 64f0ae9a-7d9f-4662-59e6-08dcef906f1b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|10070799003|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?NI+o16iFJvdlcdujYcMC3pAo+/pYfdBGab8u67C097Q01hXwuR2Ac68pdSt3?= =?us-ascii?Q?n/LlPte30u3PqztHYSK+lfPjzEykzGCkdQhJKN6FOLCD8xA4lgt3+cRfwrZl?= =?us-ascii?Q?1mBLqMMu1epKwGEmNkQ2Ye3de3QGt6Zcnq2wBmntbm8gQ/KJ95HYCu+8Wxi2?= =?us-ascii?Q?QgYpYvrZ6EtVheZjMRRbPIxKJwTKu/LJZ6WObDcjT3dfK2iNzSA/LDJmUM2i?= =?us-ascii?Q?Q+n1v+BlfhICvAlYzcIOvSolSMFVL15AKL9IJCziJ+UfU83w55fzWZfh1TaQ?= =?us-ascii?Q?CNAhMQqiPzDo2g+e1Hd9c08LEp22jyrwpUjRB8RLzFJcIXwl6gxZdwr36cdu?= =?us-ascii?Q?xhpxmV33Z7ErhOZPZeHekgKTAe0miBc21rYlLxAkeIzrgtNcc759AgH8eyfD?= =?us-ascii?Q?AuB48yWmbixfrNdepnJ7aKZLXI4UpXu5HAI1w85uR5kViquqVO/WRbeQmMHW?= =?us-ascii?Q?KNcGrhqxn8VpiXc5S0KlIgTfgpNFPWbfbLdbJf0taIZI3A0d1YokhXaqv88z?= =?us-ascii?Q?rRIDQLLfTCbuRa/2s/rtVz7CU1KRNcoaQGCs9BnOdTWIJmQvVKHtRK5UNmvW?= =?us-ascii?Q?x0jTQMd9MNHyl+s4keMu3QY7dTIh35jp2R745OkODVYbnXsM/zfExCVOemeG?= =?us-ascii?Q?ChrTmc0ZeyzC3GmQGTN2QMUPFGBr4KODb1X2gndvH6QXvuKbgxZK+9KWQp0H?= =?us-ascii?Q?bPu9Ri0DemMm8+VromzYpYG++15UShVy9Q0d99lv6PnnLeExnfYbBYbuHorq?= =?us-ascii?Q?nimayNFOS97Cu4AxM/YiFeIAHrxszwodW0Efcws8ETuNVCN8zkd41yY2hujR?= =?us-ascii?Q?6gdBmgZ3hRiE5GNabtDourFNNE7aTvRzjKetLfyBruUN8hNOr3qtgIwu/1n1?= =?us-ascii?Q?kLEG6F8HHd97AKcCC5vVcH+6gQJQu5S7JGtyxXr0OAoHQHHYZ2NPJb/4lLBs?= =?us-ascii?Q?gdG6HDx5GkT0w2WGUdSZfnDPDRZFoFKbCtgrXoqhKLgtyxs4sPz7MVJmdUn3?= =?us-ascii?Q?N1bKi9NjEMcNL/4g2WFbkKQ+j4ClzUQwr6cEvd6JtyRUwPZj5/3z6NSJ3v6q?= =?us-ascii?Q?yBXhome2N5GRR/8vlUDy/Qp/yAq5UJb5wRnqN+5WuTJ4P8RHzjzKoFOXT4hn?= =?us-ascii?Q?6meaJAYauOpTpzC8255VRWMtN5OBUQ0mlNa+tJ5GriUe0iIoxsoBvJN4O69M?= =?us-ascii?Q?VzyQBYqZ24x2Zqa79L9e4nbhkv7S6t42PoT60jruKMtvtPqIQlVTcaIVVvwk?= =?us-ascii?Q?V6sKnpP6CYT4GUxw/FQHVLHssm5qDuLvYqFjwOLQJ4gN9oBNuwNi5/6jA/sm?= =?us-ascii?Q?H98dpORyQk3RbYp+qZWUKRa4?= 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)(376014)(7416014)(10070799003)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?tsKWWQD3RNfJ0JMbxTsL3/kEmTgGbRPZTRRvn0n8D1f3ixjP1k2iOlVw/+IG?= =?us-ascii?Q?FXw9eYAWA0+EiPyfD73MwmUy6itvt6X/u2G2jpkQbQ7z8uIcxMbBiFoqYiLw?= =?us-ascii?Q?XmvYQU/4/GfIEiYKwQ/gQFB0mnBlHESGtRSgUsaia8XUjOtWflpYOS80VUlZ?= =?us-ascii?Q?ASqIJSE1pf9rKzQkDFEbQLiBqP6WqBJUyQmUC+NEHJnR3+SoGjTaYc5w++2x?= =?us-ascii?Q?3F8MEDJRjs+M+VB7Z74flcxyl0+TAsIrEAu6EjXN9l4x8fzqIQbIJhueymzD?= =?us-ascii?Q?+BRxxYgsJFB0c5vN3V440zp1ZipFlDMo0Ds7kqn/UZeOq+Fu1D6gHD5ZQzeL?= =?us-ascii?Q?4YymbXaZcHSRRvn1kcwwu/VkcvNbZ7z3tQ8wXmqBU2EaaHfpRMSa9ADDX31R?= =?us-ascii?Q?QlZGIwzbMf753aGJqiTelnSz3Ktu+p+6K11SErIJgZJfLaLpAuJw6/SJit+Q?= =?us-ascii?Q?2xS6NSh2o21hyR53JCcXi2zcUemd0LogC2SI0WU+JvNCaTDnabESSBJX50ZN?= =?us-ascii?Q?QLxkFxBPvbWTr2wK3Kmzw5fZ4vjK4nZzyHL2+6unDnN5ANCU27tSO1A47Iey?= =?us-ascii?Q?METM/FxtflhOU3UbnPdJtW6OojLszde6oecTWzVjJSCyXhtR9sFnmkL7B9d8?= =?us-ascii?Q?MgrHQrtmFV/aIgWFr26obzZ/i9jd+dklMwOC36VrnNVkzRzP8aag4+pCzqMa?= =?us-ascii?Q?OcZ2Z2zf+MmOTe49Otk7Ke5PT+R1eirnympTOtCDtuBm7EPffVzIlJlU2fkq?= =?us-ascii?Q?nCXbeAXHOVtJesjmV2EY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?= =?us-ascii?Q?73UdMw=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ciHQi2Jl41bwu9Ott5qsw1iadcjLtKvJJQ2hsaodB1NFJSb6vABJzSJkEgo14YeulrzAeeyOERmSDtp7eUzGGpsYBAdMkNxSBSKs0NF0G44MGf2AtJYkuQOg+/Elw9HjaSbV95KlRKtUNDBgYpUb7vIBkhKpaHxxwU3AL6q8AsKoQL89jW9U5CZB0oIqXxbT7O6Eq0C5WIc3AhraS0WAO82eyOK+pecgf179vqAUQIf9JFejLmxh2IxVqRZXinirC9CUwvBwp5Ik4fLRNF/HIPfnkUEtCfrPEu5FDW5p22AtRHoBPPHDVJc0z7hurxSAryBnXig99El8t3bxnnbWQ/cv7SpOJ53tN5X3rChfFXeChHDwU/MUBkLryXleuWtWUVYCzbTqviUfeozn1cNTZ/XNbdvmAufgLrVhiKDtAl9QiHNrShEVxkueKT/Tp44J5hCS+qa8YkrVu9MfMEP51GfH9HrochZdmqlfJBgv5LhU1j5lULuWuib2H/v31IbWqWjEDFcD0h3fgCzYFsQiWGi2ShPFHgjtnvjkolbvz2ITJ8cmPxHhPVGZa10pb8FGyFSScyd0U6nYjBQGH5qI/46PNEI86GmLCPodfqoPLU4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64f0ae9a-7d9f-4662-59e6-08dcef906f1b X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 16:18:00.1302 (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: Z/Nid4AoRKjx094r/7sM/GSxu3uX13GrohRi7Eqq1HHl0bTT1IJGSUsfeQhxui7qLKHxoPOM0BlR34fOKJoz5S4QDdXuQsqSfAdUZw0c0Yk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5895 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-18_11,2024-10-17_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 adultscore=0 bulkscore=0 spamscore=0 mlxlogscore=868 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2410180104 X-Proofpoint-GUID: oPw0X9r32Qb23mJZ2Psg130M6B9khBKy X-Proofpoint-ORIG-GUID: oPw0X9r32Qb23mJZ2Psg130M6B9khBKy X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: B344C40004 X-Stat-Signature: qjnqrw6nycp7pnos3hp9p6hrnn549r46 X-HE-Tag: 1729268298-226377 X-HE-Meta: U2FsdGVkX18gLFt5N0C7DSvthyXl4NK/sVitMRBvB3inRxbJumrjJIyunRiydt8/1+fcgS9jXBimvG4eDMX6DpWT00qpwNFmMXJQ2mL79zj2vTgppxiyhkj55V5yFaGPZIfh2+BHmYHZukiz2A8sVlP8Hs6mXD1+2Qu43BYosoihuJhjRAexG859pcxjNxoy2o0gXuxCK/79YtiO96zV0uS9SkyluRtpQzDzc7INlc/bh7fMkiccC5hpAT7hXLid7otcgz5/MjtZycrcyDKFTET570tENOPSXVsVB407Xc+4qO/pvrqkAcHqsm+l1sN977N3/GcOTelQaoJy8rnPQBzL0xEfA3mcqHllCPuoB/cWOM4dPVQkjwmNr+gNx0DBLMHiY6CdvjHYSo8Q8OPJ6qAVO3daDveTJ/neq7whNgok9aMVY/2EdPD7UXPiAhqOQwm2dUfHLYghU36ZOGhTwoyZHmtS3+IGCmmC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kFHQbCCD0q9TfoZhjoMBA4K88nuKss16F+g== 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 Fri, Oct 18, 2024 at 06:10:37PM +0200, Vlastimil Babka wrote: > +CC linux-api (also should on future revisions) > They're cc'd :) assuming Linux API is correct right? > On 10/17/24 22:42, Lorenzo Stoakes wrote: > > Userland library functions such as allocators and threading implementations > > often require regions of memory to act as 'guard pages' - mappings which, > > when accessed, result in a fatal signal being sent to the accessing > > process. > > > > The current means by which these are implemented is via a PROT_NONE mmap() > > mapping, which provides the required semantics however incur an overhead of > > a VMA for each such region. > > > > With a great many processes and threads, this can rapidly add up and incur > > a significant memory penalty. It also has the added problem of preventing > > merges that might otherwise be permitted. > > > > This series takes a different approach - an idea suggested by Vlasimil > > Babka (and before him David Hildenbrand and Jann Horn - perhaps more - the > > provenance becomes a little tricky to ascertain after this - please forgive > > any omissions!) - rather than locating the guard pages at the VMA layer, > > instead placing them in page tables mapping the required ranges. > > > > Early testing of the prototype version of this code suggests a 5 times > > speed up in memory mapping invocations (in conjunction with use of > > process_madvise()) and a 13% reduction in VMAs on an entirely idle android > > system and unoptimised code. > > > > We expect with optimisation and a loaded system with a larger number of > > guard pages this could significantly increase, but in any case these > > numbers are encouraging. > > > > This way, rather than having separate VMAs specifying which parts of a > > range are guard pages, instead we have a VMA spanning the entire range of > > memory a user is permitted to access and including ranges which are to be > > 'guarded'. > > > > After mapping this, a user can specify which parts of the range should > > result in a fatal signal when accessed. > > > > By restricting the ability to specify guard pages to memory mapped by > > existing VMAs, we can rely on the mappings being torn down when the > > mappings are ultimately unmapped and everything works simply as if the > > memory were not faulted in, from the point of view of the containing VMAs. > > > > This mechanism in effect poisons memory ranges similar to hardware memory > > poisoning, only it is an entirely software-controlled form of poisoning. > > > > Any poisoned region of memory is also able to 'unpoisoned', that is, to > > have its poison markers removed. > > > > The mechanism is implemented via madvise() behaviour - MADV_GUARD_POISON > > which simply poisons ranges - and MADV_GUARD_UNPOISON - which clears this > > poisoning. > > > > Poisoning can be performed across multiple VMAs and any existing mappings > > will be cleared, that is zapped, before installing the poisoned page table > > mappings. > > > > There is no concept of 'nested' poisoning, multiple attempts to poison a > > range will, after the first poisoning, have no effect. > > > > Importantly, unpoisoning of poisoned ranges has no effect on non-poisoned > > memory, so a user can safely unpoison a range of memory and clear only > > poison page table mappings leaving the rest intact. > > > > The actual mechanism by which the page table entries are specified makes > > use of existing logic - PTE markers, which are used for the userfaultfd > > UFFDIO_POISON mechanism. > > > > Unfortunately PTE_MARKER_POISONED is not suited for the guard page > > mechanism as it results in VM_FAULT_HWPOISON semantics in the fault > > handler, so we add our own specific PTE_MARKER_GUARD and adapt existing > > logic to handle it. > > > > We also extend the generic page walk mechanism to allow for installation of > > PTEs (carefully restricted to memory management logic only to prevent > > unwanted abuse). > > > > We ensure that zapping performed by, for instance, MADV_DONTNEED, does not > > remove guard poison markers, nor does forking (except when VM_WIPEONFORK is > > specified for a VMA which implies a total removal of memory > > characteristics). > > > > It's important to note that the guard page implementation is emphatically > > NOT a security feature, so a user can remove the poisoning if they wish. We > > simply implement it in such a way as to provide the least surprising > > behaviour. > > > > An extensive set of self-tests are provided which ensure behaviour is as > > expected and additionally self-documents expected behaviour of poisoned > > ranges. > > > > Suggested-by: Vlastimil Babka > > Please fix the domain typo (also in patch 3 :) > Damnnn it! I can't believe I left that in. Sorry about that! Will fix on respin. Hopefully not to suse.cs ;) > Thanks for implementing this, > Vlastimil Thanks! > > > Suggested-by: Jann Horn > > Suggested-by: David Hildenbrand > > > > v1 > > * Un-RFC'd as appears no major objections to approach but rather debate on > > implementation. > > * Fixed issue with arches which need mmu_context.h and > > tlbfush.h. header imports in pagewalker logic to be able to use > > update_mmu_cache() as reported by the kernel test bot. > > * Added comments in page walker logic to clarify who can use > > ops->install_pte and why as well as adding a check_ops_valid() helper > > function, as suggested by Christoph. > > * Pass false in full parameter in pte_clear_not_present_full() as suggested > > by Jann. > > * Stopped erroneously requiring a write lock for the poison operation as > > suggested by Jann and Suren. > > * Moved anon_vma_prepare() to the start of madvise_guard_poison() to be > > consistent with how this is used elsewhere in the kernel as suggested by > > Jann. > > * Avoid returning -EAGAIN if we are raced on page faults, just keep looping > > and duck out if a fatal signal is pending or a conditional reschedule is > > needed, as suggested by Jann. > > * Avoid needlessly splitting huge PUDs and PMDs by specifying > > ACTION_CONTINUE, as suggested by Jann. > > > > RFC > > https://lore.kernel.org/all/cover.1727440966.git.lorenzo.stoakes@oracle.com/ > > > > Lorenzo Stoakes (4): > > mm: pagewalk: add the ability to install PTEs > > mm: add PTE_MARKER_GUARD PTE marker > > mm: madvise: implement lightweight guard page mechanism > > selftests/mm: add self tests for guard page feature > > > > arch/alpha/include/uapi/asm/mman.h | 3 + > > arch/mips/include/uapi/asm/mman.h | 3 + > > arch/parisc/include/uapi/asm/mman.h | 3 + > > arch/xtensa/include/uapi/asm/mman.h | 3 + > > include/linux/mm_inline.h | 2 +- > > include/linux/pagewalk.h | 18 +- > > include/linux/swapops.h | 26 +- > > include/uapi/asm-generic/mman-common.h | 3 + > > mm/hugetlb.c | 3 + > > mm/internal.h | 6 + > > mm/madvise.c | 168 ++++ > > mm/memory.c | 18 +- > > mm/mprotect.c | 3 +- > > mm/mseal.c | 1 + > > mm/pagewalk.c | 200 ++-- > > tools/testing/selftests/mm/.gitignore | 1 + > > tools/testing/selftests/mm/Makefile | 1 + > > tools/testing/selftests/mm/guard-pages.c | 1168 ++++++++++++++++++++++ > > 18 files changed, 1564 insertions(+), 66 deletions(-) > > create mode 100644 tools/testing/selftests/mm/guard-pages.c > > > > -- > > 2.46.2 >