From patchwork Thu Aug 22 19:25:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liam R. Howlett" X-Patchwork-Id: 13774111 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 33DF4C5321D for ; Thu, 22 Aug 2024 19:26:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 09CD980049; Thu, 22 Aug 2024 15:26:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 048778004F; Thu, 22 Aug 2024 15:26:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A35CF80049; Thu, 22 Aug 2024 15:26:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 74CCB8004F for ; Thu, 22 Aug 2024 15:26:24 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 35D97C18DD for ; Thu, 22 Aug 2024 19:26:24 +0000 (UTC) X-FDA: 82480862688.13.2328B6D Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf14.hostedemail.com (Postfix) with ESMTP id 98750100011 for ; Thu, 22 Aug 2024 19:26:19 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Z8UpFi4Q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FS9fdp2p; spf=pass (imf14.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724354762; 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=CneEaELPIVdmEDhnSNMWg2uSW5EOWAEp6X+PaxnpZ/s=; b=Dzdi76u90Ggdv3L6ufIsLRmkzbGyCdmeeO0jlomfwAM7uObEoplygbRHjDQQ2u5d18bpHc 4L7Jy+8jkjl1WPKJwTf0vqZBIGtNuhqUvlpWy+T+ZUzPGQhOzK38XJLtex1Vjb9f8Z+2yB vkJUTmkePQ/OGqS+oiUgTvoNMprj3Qw= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=Z8UpFi4Q; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FS9fdp2p; spf=pass (imf14.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724354762; a=rsa-sha256; cv=pass; b=PfCQCZPa1UTnXIBE51F9BVOxhiYTy0DmgouXGGkoeReKedaCAojD96zcIeAG4Hs3XEGRUb oW5VLAfzBCoh5cElPxY9KWXXW1wfblFFy6mZy9RJqJkLy2rYRjZgsVmSGgpTk+33eDb9MD C7mw2kEPR96vXxLztPZWD/2hEbJcP3Y= 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 47MIMnni001345; Thu, 22 Aug 2024 19:26:07 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=CneEaELPIVdmED hnSNMWg2uSW5EOWAEp6X+PaxnpZ/s=; b=Z8UpFi4Qq0m+dTy971Zzz/nKcB3uWa NMKGuonxchmhvj5Y8c0ghqcEidB5kdTyWrw0tWCn5M9kGpXpQiJqMJ6MNJXaEtbg SyPdOCNBz0olyKD0P/4Kp9lQpPUFydOxe+Ps5mQN/cOj3Dn5kkLMwQ3VKGA9/9ta Auh49OOcfFLWxtu4IxQCJG8yMyjYwLZNPY2H5PoZAR/e74IZsV/qNsXb0bMbyA8H 978yzlVwXPAnDQ1tpR5rNTPSlsLiASR/oF8sGXa7dNh7ADjeDl/WbHMlVMFLFTDr 4ZpmY5iXCRTIZonkBTqloewhCoo8b6OMW90LXOMV2stOI0PK/We6/ctQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 412m6gjwqw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:07 +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 47MINtZl028119; Thu, 22 Aug 2024 19:26:06 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2173.outbound.protection.outlook.com [104.47.56.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 416ajutjhs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KRYu3RUyUT19ktb36XqO4eQQU4ReZADLF/eMl8mtDKk2LIpZW5m2q0TcR4WqqPR2nOFY6ZeqEWknfV1WfT7zQbyXGDceQ3YYDR0qiUlQRdk0jUj9RrXci9Eiir62B3TSWHyGM3xLj/M5EJ+uo3ZaA0DFtQHcNphWUp4CqiwF9GzKDToGXZ2g2zQq876oM7mfJqpM4QjldsKAGSFJfWyVz4vnzWqg/MpSgaYmWeVyxF14DSrFx+Svttv3fffrXgZc41EbObErTZ3LXYaNgHIs3sXQddu1s7j8e8ZX8NllhAPpfIzZKfF5xBHmQMh0iqwuBWsu1ZguDki6kBnLWknIiA== 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=CneEaELPIVdmEDhnSNMWg2uSW5EOWAEp6X+PaxnpZ/s=; b=ruHxZnUEpC1m5ttzsCP008RmUWFwg8NT1xM4lapjMStoQRvL9SEJAEu90KOMWFugfaFqk4pmXoXZyaSaPdJ/CB1hv82748SMwwiCYCBZdPGMqUAET3+Myfm6+rCDIv6ZtV1HTa7aE2Q3t5EUdk7k3zE2Wc+FSUwaEHJaNU8T/JQF9F8+n5AAmPkuDNVdXr0gL6JMKsH0iJtWKmzH4tLXk9Ffc/k7jx5quCsQ3fBu9I1ouk70kRoAy+1qPck0Tup05ULmTIuuARu8MpUtD+FgpPt2HlFVaPrnlf7fOfs99NnllTn+IP/XfF3DZHUAjqtA5R0MH4cRscPTuWGCh4GxVA== 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=CneEaELPIVdmEDhnSNMWg2uSW5EOWAEp6X+PaxnpZ/s=; b=FS9fdp2pGs3+OPyGssgYo6peA/eGd5lhUlIa7CA19DTvFmyU4PdSWKnV8VRWJyxLuOqPJunZ6DLZgWbbS0mmdBey0rC7+rzq9x9PKwwQCAKexeqdKQEbKom6KWhYgEnJ4Pe7QqtY9FbflGWMUBS8Us+PP4ZEC/GiqvGUAY6aZrs= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CH3PR10MB7356.namprd10.prod.outlook.com (2603:10b6:610:130::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Thu, 22 Aug 2024 19:26:03 +0000 Received: from DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490]) by DS0PR10MB7933.namprd10.prod.outlook.com ([fe80::2561:85b0:ae8f:9490%3]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024 19:25:59 +0000 From: "Liam R. Howlett" To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Suren Baghdasaryan , Lorenzo Stoakes , Matthew Wilcox , Vlastimil Babka , sidhartha.kumar@oracle.com, Bert Karwatzki , Jiri Olsa , Kees Cook , "Paul E . McKenney" , "Liam R. Howlett" Subject: [PATCH v7 00/21] Avoid MAP_FIXED gap exposure Date: Thu, 22 Aug 2024 15:25:22 -0400 Message-ID: <20240822192543.3359552-1-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 X-ClientProxiedBy: YT4P288CA0078.CANP288.PROD.OUTLOOK.COM (2603:10b6:b01:d0::11) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|CH3PR10MB7356:EE_ X-MS-Office365-Filtering-Correlation-Id: ce4cbe77-bf89-4244-6fc2-08dcc2e03cd1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|7416014|376014; X-Microsoft-Antispam-Message-Info: NHsblPQOPd0+Zs6b20HkfT30J0G2GvCclc6qSxV3T7GkJcjmPpYkDGsn4j2tvH+2XjOtV6EGezPvZoYZruhMXkX7KXX8zRPFqjKySRaNzos/DyBJATYHW+h5UgoxD6Bz/ny3Z/SJrlX32kxLK3h5bvP+5R8DUg3kercEmKUqIbQf6NzUoHQahFS6WRDpiedOw8OAc5AQuFuFveN7XmVlkmDhF49L6gapZDkjgJZkUoShV22k86hdaymvmkJ4tJsq/k6LK3cP+JzN04nGIJNS0gN8KKO9b2BEcqfX/V61AL/iBxbi4bnQtDQbH8rSOb46X8/bu7O02Pq80olIRydkX4vUoXq48o3pTwOZz/KcbLpbUyg/+Sld9ifJWiLsXmgBYkr+MPqC2Wzg5DCYnDl/dmCbpb6yUhobVhpcFv9S3r57+KhPVvFeXcf8yej6wutX/ua1dCOE64i+MAlvDta/0XnkdSi8thh20teXMdzLgrwEGqgu6/pHAxHQBFxoTkqL8/Fae6NxZ+e56mXhyTXchPM46iDkwajTlBcP2C/K5w30HmVgnhfLP4vmBSLwNV8fy/ausl18vBOVoP+9dLoCgvtEX4yPFHMjfuaUQXOM2gngrvrTTg8tQuiR9dxm8W1NgI/W5jXUuilVT0iwsz9Wq6Nm26MpRz/5v8YkrdJbDZ9It53s7tIXK0C1Ab5RwncfgdgLkP3Qul4plLuuupYox4bQIaPsRCxDY9nxYwtp1QETb3G3LflQYG5EoXJ8dxcIQ8u8v7wqZCO/SPcAaagmohrXhyG7diw01TVuGIAcQ1LkYq+tY2hsKrxfklOYT2iqg3FArfV/elvPkmfXh2LG8+dC0k2VlVElPYd4WQUlCAq/nZk04CpABfKrkRGBfgaBfOMeCYROzFxR9c9KR0ohGol7MeiVfeFc29/B22eRxP9qHdS6xclIryNZsVGCbtw73i/087zHqJzHe59R+1PNCFanP0Onjmy0xQYIrksH9IMlWfadvillZMhLgi014EU0zxxArw+pXMApTSMusMyTH9qnu7nAtkqqzyfubPGT9+i+lQXDzlRrdi1kzwlJRijWNbvAcNOneuLHJodeisw66rQ+gds9rnXt6sWbWywS0KV8KLYOpOVxNL434lN3SW1oqv6i14YZhiN/ywFKDXShvgw8WTTnpbOFdZt8OUGs07Ju0J2YoCTWX+u8Y+C2ja4TXFsER8MqWvPRiPajvXFvo192+elqckfs1cOlv2MnzMGI3bpFd/qgVuwhSb/a84OyxSTbuGLpps80xBfHcGADs0k5nYqskQsmcv1mIORzyiA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7933.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HRpWWrG3QpW1t0MipP8KOMpTcNJmeLDm1t+BLYr30JjpY4SEy5CuuGwE+B5r+2CSJwzwq0sIa2TS4G7NQeEv2iBDZ8RdzaZq4P5DPOda4qyEjJhzo1XKGUXurZXtaCgyrJfOmWdvih7XVz4VpN3IHJZJHTL1fjKB34tSUSUffFRMh++SgyTXztp5tLBJP1Vn0LPLDWfAlqnh6U0v9yl0tYwAH6QdA3rP6pPOV37ReNy+BQ756DgPi0hIPmKL5Uv5WQTLlAHJ+qSLmtVmLfjB8KeXJKjs2EdMkvb2HGWAi4o1S2H4Aw3byQREt+CYrUU4OvdWYGio3kw3DMMML2DnQACQiuR3vwz7lb5hpIjMRUfQc2vFvKUG0nKYspA6spugE02f99K42hmLv6pIRHeObqbGv7Ilk8cbBAUOLnXG0I91T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bfDuq///2kO2o+gzCM54/J2wkevmg1IUYWLIvOSh/E7xHXF1a3snB3+Lh3zL7TpMY9R9oe+OjiZRoV1kakdHSPb X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: kfkqksVI65SjmSxuOdoSyw6RTYurLWQbLBQMHL5lRzc3c4BTQsgill1pieAbvMbnH6spG/cNUer5P5DdpRbR1uNIJsIItdkQ4rDOEUxOFk4PjNzLRxDMXdgquuOJ/p+EWMKKQY5buwQXVrw38h2+3sHfnZWXuh9gYmcDoizKWfgOlgGzFA56JgnsCrlf80h6ivscegznKOOxGGOW7NZhTGW3ENshA9ARIZichryPEHUL+wruutyoZmmN/d9Xau2zNDOIfEXtyfcEcJDDT5bB+3txnqmFZawuQ3WlI9lLXyzUn/HUEFuaFFV6CuUBv3Gfxqzu9X+Wk9QAAg7YzfAsLdW/DhqagojB10mz9dBqcrPQ0IDtLc/NZx13dmbwWzrYuV8xCTym+c2kL10RGO7wDCtk/8jOJEJRym1tYQMugg3B/8F1gwN038WI47fwQjw7yjicyfP2XM2YV1MMNC+30VO51t6RlqNd/yfJncHqh4EnEBFqCc/EJB7dSfaPCywbBraWD5bvnFk3BTt9GUK73V0gmCXIsOix3g9Bx4HfuxKu90Ypi5PbC6d94E7yDyffH3E2EY1KUmCZposjYZTwh4G1D/bRuSTXLuP78N8oX0g= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce4cbe77-bf89-4244-6fc2-08dcc2e03cd1 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 19:25:57.3279 (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: prZ3sub5PIYAsRpI69eqKmSzO1raFe/pXFV8iQEKLRoJaQPVz+WZnlNbvt8VhTVTGaO4wtF9D+SE2keeuGRoTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7356 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-22_12,2024-08-22_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 adultscore=0 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408220146 X-Proofpoint-ORIG-GUID: 9MaY4qcxEPmL5xGvaJNS9ykAoLDUN8fU X-Proofpoint-GUID: 9MaY4qcxEPmL5xGvaJNS9ykAoLDUN8fU X-Rspam-User: X-Stat-Signature: c3b5awruwk75fjxi5ugcxreuyjskz5tq X-Rspamd-Queue-Id: 98750100011 X-Rspamd-Server: rspam11 X-HE-Tag: 1724354779-249850 X-HE-Meta: U2FsdGVkX18Tz7CNgCgb+4FhEwcRrtp/lazCBqubtIfegqfnYCWoTDup+4N/MDsunIdJJSNUx8hmACDMtGdujbDXU/fPOIRlJFYUWGux8FqZCF0mHM59ZwoLtc4BWs4qWVmvsRMaNPXS0K5dDO6DuoW9q5yWubl+f6ur1Fs+oGN8pDWwdza1WFNmmOk0Lhs7eXtRWbYdECRLROnwxBPjMD/rEZI1LZKOUytBY4G4WvkXF/XEnQlV+sYt6f4D64tZ66amGqlevd3UaFQ5erpNBekYeUvd94JGtUU31EW/rhH+vfRljz/BmrXLJAEoAkNED3tS6IOz/0kIdA+On24db5rAP76QOdYNFYaYlZHMqC0UXz0Hf3Yl+oCXUqcFci8tGZhgSezByfCSOBfVEYqAbWBVuUK+EWzI3sa2dpTsP9gNRvCKIef392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pqMkwDZK+NgQK5mMC+ISw== 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: It is now possible to walk the vma tree using the rcu read locks and is beneficial to do so to reduce lock contention. Doing so while a MAP_FIXED mapping is executing means that a reader may see a gap in the vma tree that should never logically exist - and does not when using the mmap lock in read mode. The temporal gap exists because mmap_region() calls munmap() prior to installing the new mapping. This patch set stops rcu readers from seeing the temporal gap by splitting up the munmap() function into two parts. The first part prepares the vma tree for modifications by doing the necessary splits and tracks the vmas marked for removal in a side tree. The second part completes the munmapping of the vmas after the vma tree has been overwritten (either by a MAP_FIXED replacement vma or by a NULL in the munmap() case). Please note that rcu walkers will still be able to see a temporary state of split vmas that may be in the process of being removed, but the temporal gap will not be exposed. vma_start_write() are called on both parts of the split vma, so this state is detectable. If existing vmas have a vm_ops->close(), then they will be called prior to mapping the new vmas (and ptes are cleared out). Without calling ->close(), hugetlbfs tests fail (hugemmap06 specifically) due to resources still being marked as 'busy'. Unfortunately, calling the corresponding ->open() may not restore the state of the vmas, so it is safer to keep the existing failure scenario where a gap is inserted and never replaced. The failure scenario is in its own patch (0015) for traceability. RFC: https://lore.kernel.org/linux-mm/20240531163217.1584450-1-Liam.Howlett@oracle.com/ v1: https://lore.kernel.org/linux-mm/20240611180200.711239-1-Liam.Howlett@oracle.com/ v2: https://lore.kernel.org/all/20240625191145.3382793-1-Liam.Howlett@oracle.com/ v3: https://lore.kernel.org/linux-mm/20240704182718.2653918-1-Liam.Howlett@oracle.com/ v4: https://lore.kernel.org/linux-mm/20240710192250.4114783-1-Liam.Howlett@oracle.com/ v5: https://lore.kernel.org/linux-mm/20240717200709.1552558-1-Liam.Howlett@oracle.com/ v6: https://lore.kernel.org/all/20240820235730.2852400-1-Liam.Howlett@oracle.com/ Changes since v6: - Added ack by Paul Moore - Added some more SoB from Lorenzo - Fixed some minor comment language - Dropped extern from header - Removed constant from argument list of vms_clean_up_area() - Added VM_WARN_ON() to stat counting - Removed duplicate counting of VM_LOCKED vmas - Renamed abort_munmap_vmas() to reattach_vmas() when other code is removed - Added description to vms_abort_munmap_vmas() - Removed mm pointer from vma_munmap_struct - Added last patch to make vma_munmap_struct 2 cachelines Liam R. Howlett (21): mm/vma: Correctly position vma_iterator in __split_vma() mm/vma: Introduce abort_munmap_vmas() mm/vma: Introduce vmi_complete_munmap_vmas() mm/vma: Extract the gathering of vmas from do_vmi_align_munmap() mm/vma: Introduce vma_munmap_struct for use in munmap operations mm/vma: Change munmap to use vma_munmap_struct() for accounting and surrounding vmas mm/vma: Extract validate_mm() from vma_complete() mm/vma: Inline munmap operation in mmap_region() mm/vma: Expand mmap_region() munmap call mm/vma: Support vma == NULL in init_vma_munmap() mm/mmap: Reposition vma iterator in mmap_region() mm/vma: Track start and end for munmap in vma_munmap_struct mm: Clean up unmap_region() argument list mm/mmap: Avoid zeroing vma tree in mmap_region() mm: Change failure of MAP_FIXED to restoring the gap on failure mm/mmap: Use PHYS_PFN in mmap_region() mm/mmap: Use vms accounted pages in mmap_region() ipc/shm, mm: Drop do_vma_munmap() mm: Move may_expand_vm() check in mmap_region() mm/vma: Drop incorrect comment from vms_gather_munmap_vmas() mm/vma.h: Optimise vma_munmap_struct include/linux/mm.h | 6 +- ipc/shm.c | 8 +- mm/mmap.c | 138 +++++++++--------- mm/vma.c | 357 +++++++++++++++++++++++++++------------------ mm/vma.h | 164 ++++++++++++++++++--- 5 files changed, 428 insertions(+), 245 deletions(-)