From patchwork Wed Jul 17 20:06:58 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: 13735742 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 AA00DC3DA5D for ; Wed, 17 Jul 2024 20:08:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 908696B00A0; Wed, 17 Jul 2024 16:07:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 892AA6B00A1; Wed, 17 Jul 2024 16:07:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C0076B00A2; Wed, 17 Jul 2024 16:07:51 -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 4C32A6B00A0 for ; Wed, 17 Jul 2024 16:07:51 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0582C160CC1 for ; Wed, 17 Jul 2024 20:07:51 +0000 (UTC) X-FDA: 82350330342.03.E699F85 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf26.hostedemail.com (Postfix) with ESMTP id B9EEA14001B for ; Wed, 17 Jul 2024 20:07:47 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=LfS6mrRI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fQcGhEC9; spf=pass (imf26.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@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=1721246836; 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:in-reply-to:references:references:dkim-signature; bh=S37ZWrf+uGjTlHx8kEYsOJHDQEEph06qnirTptSS0/U=; b=IYwtbA5krez7q2mEKu8TemBhIrIemscmvm5p5dsvPuYxC+q8c1QVpxNnaffD9ZUB/xlIcT 50E8CKquUY7hPM5skReY6EiNbw2bWHppNN/bPi2mbjjrZ8fagX43U6NnofODKyNoHNAMq8 k0lUp/WaUmUyxg+OhnrLm0kkBf4MACw= ARC-Authentication-Results: i=2; imf26.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=LfS6mrRI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=fQcGhEC9; spf=pass (imf26.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=liam.howlett@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=1721246836; a=rsa-sha256; cv=pass; b=Q+ukn4gCb47trP8k5nczcrHVrRaBSYoYNnskyTQvJpf/tOnMldrpXWpabwkwpvqwr+lqLb 6706nJYx23SCyL+b9GptgQ1RF+WyhdINcP1k9gp2YbYVuRd5SIaNCZEF3TmRoS0lZ7hmQy /0tVQcKQcC+nKgbdd2dHCxDa4WbEAGI= 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 46HK0js6029063; Wed, 17 Jul 2024 20:07:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=S37ZWrf+uGjTlHx8kEYsOJHDQEEph06qnirTptSS0/U=; b= LfS6mrRIfemTMAlMIdrimYUoynbGPKJ+l9SGCvjRCSjk06gmaZikCIhBcisw964/ M2tuld2XJE2afpY9ItpNykqXn9lV4lWXuECpNLlCQTlkw7Nc+g0zLP7xyMK3Bzkh Gi7qnibnuDcvS+BBVhx4pCGYuyuw+EG2CuNFjCeQenA3SE//6XdW1E49G9JR+mnd mjcDxKlRI8J3t3acQfMbnybgylEnTVCsFLaLp0C7+6SkgqdsvsEY/QWCne6ukiM9 oUxEwF20IG3f6OgQI7UL3K5MEvCQ3blUGlH8VSXHqFMkCt4hhCRWLLTfZ6+/Ev38 ZI2P3q1RcZKNpgdnwJyd7Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 40emkyg19x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:39 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 46HJmtKI031693; Wed, 17 Jul 2024 20:07:38 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 40dwexugp1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jul 2024 20:07:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BZ/ZwiecW9/6oMuncH6VVKvKsY0NvK+CfK3CvzQoVLz4tytgWumvjMw85uzmz5EPDt1gxP8vHVZqhRjztZSFkfAk3y1izFGPFMUsZVYEl7zUj2GwnuFq2bc/TQmMsSrOtv8YnEnxGQ1a2mMTZCCrrCrryb4zqE9mxRa6awcSndHPEGRfo4nxhz0XzB7VGqHrfLs8KutQZmtzBgUZB6y1PBaYRVN2sqkyGbHQmP6abBPtlD2XeQ19GuYmAhdP/R2BIjSZfnJ/HjcSPxqidAmS9ve+Mvplo8bhBcTJ7NMYAf8QrLqLlKVJPoP0E9Su1TPAy6Q3lgRGuAA4tcOo+0Ho6Q== 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=S37ZWrf+uGjTlHx8kEYsOJHDQEEph06qnirTptSS0/U=; b=p0oe4vs89fd6UGGhEroClw7ydAdzakJiPjh6p72oY4EqgIr3RToNvgoySakZRIjPyuJpKYK4OyxHOZ9hdvOHjGRHFEuKxfOhqFK+cHkGqiOB5vp0GfMoZRqP+BDG29RnMZC2wPNFk+13lyt8QhdvxByGVTRq2mxjttbPyyO4hvr9Ij4DjLFGHewStPM9ztxX3aq9FIwMJS8rd/yZDAjQ9bjoAR+ake5I0D4jyuehKXrdKntBRJmOb6oPKZ2vjuT2wgYp4911NlyMSbSQShdo57+ZbPWJXkgsaM0LTIBnZNzVxJRGoOU50CMhN9sTPMnqxHOew6EaxNBY+SLNHHvY1A== 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=S37ZWrf+uGjTlHx8kEYsOJHDQEEph06qnirTptSS0/U=; b=fQcGhEC9os9r923QtdTBa5LlRjykSpYFHuDM9k2OsPtB5gy7CAs5ZOkY8NDcybIuoBvvy3Jr31LdWKCJRxd7gQrqpOYabHf2oZvobUKeEWvs/XsnBlF5eipeVkpISD96oC3EQ7wjEA6W/ppTPT+0kX+JlegKuva/8mReIGppe50= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by IA0PR10MB7303.namprd10.prod.outlook.com (2603:10b6:208:40d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 17 Jul 2024 20:07:35 +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.7784.016; Wed, 17 Jul 2024 20:07:35 +0000 From: "Liam R. Howlett" To: linux-mm@kvack.org, Andrew Morton Cc: Suren Baghdasaryan , Vlastimil Babka , Lorenzo Stoakes , Matthew Wilcox , sidhartha.kumar@oracle.com, "Paul E . McKenney" , Bert Karwatzki , Jiri Olsa , linux-kernel@vger.kernel.org, Kees Cook , Jeff Xu , "Liam R. Howlett" Subject: [PATCH v5 10/21] mm/mmap: Support vma == NULL in init_vma_munmap() Date: Wed, 17 Jul 2024 16:06:58 -0400 Message-ID: <20240717200709.1552558-11-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240717200709.1552558-1-Liam.Howlett@oracle.com> References: <20240717200709.1552558-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0136.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:d5::20) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|IA0PR10MB7303:EE_ X-MS-Office365-Filtering-Correlation-Id: e3993f67-2566-42ad-0cab-08dca69c1994 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: 7PN68O8py4iovjHTdV4p2GzTeG8afpWCx49mHftk2xFhZteOhQJokObg/kg6IacHaxRzJVyXgh6lq8UA0QoUf3xrZ5SXi3U8DYWhqp2SsnjAi3oAikLnzKe6yOPM7yn9erFlJ2b5H9jRl5BISAC0JOV45ZUoG9j1AZ0y+RSoSnJuzxAqyxBoFgxP6b+HadhKGj7ksyjxNtnTDZhVdpbpD91qQuXaCf+NEUB5FPbs+CnKceEEOSRjrZrreGxz76HbR0dFI4r5L3iAMKQVAPGubuPfNoGADdwDcXAevhRBKtY+AUiPqRK8wyONOcRBm9Cexd9lVg50w3qiKFDkZA8Rt7NFgVSGVxKaycuSqweAQarhQQhGdCGwy9EbImXDrNHPMTXJr8nLWoDBwaADeXbpBQ5ZflJpRpmXiyRCZSxVc+w6QZ5jbBCHNm82L+IM/r0jyJaSKxh3pwsUc/CYKPOqzfcuwwfTtb8JMJQSUfqWQgmxHy3apbDt7Fl54olm87xyFbouvsSS/l7UEkAT4z9iYOO8Vkgh8TxXzhpbNXkydf6uwU0FHEykAe4TdR/U2W1xsnRo+n4xdwHCyyUH217DJsXXtgAXRL2eW1eR6FDH4WDyJNvO/95uQfQRoB9/I2NGBRa5KLY+dEDCGsnULfQ4dl5B5UWmYUAD5fgNPaPMrqfBndZCH/x3tcqM3w2/hvXtH6o3VMu0PCg5ya2uiLhTow5xYTCf7XD4xJwxaxMIW8RrqTOqr1kRSwuKzWeZPwjUdEq7FXGaVYtjn6g08w7aZkrOZtAfFk5pNILdwSKRHwreUi6l4TdO/f0p+6mlC76MZHR9t4st2/1kBP1Yv5go1ShX7mI1Fd22qT83SKAbDgDlSa02f7ygIm5VdzzUsR0oDAJUTwUXE5RyyblmPtdFVKiXm4zkYhjyW9Wo5oE9wGUEhMgIko7o2j/v+2a731l+IgaTFhNtweezoyabIbgKePFR/ckKi2Wa3QWtr+Vd3CEUS0enoHcG0/LLgb+LN0nWcwN2YK9rSC5CG/z5VMlWMLcJywNxYWb22zo5yh46E1lY+H+oFPwmtc8UWN+0QrMke96Kh+QEbZLsdtqsRygq0OyWL/D/euzu4ilumalFL+b3rLd1GoyBWD79PyXQ41oRV9Px93xdZ0l3U2I/EqdhC/jU/14qNYl/RdPwEEz4T9gfiRERR5PK+YzskogVCy1P7mCc5YiNIWlW/fjC6WB9hQK9pAGLJyVZ+7A+P3uY4LoTD02xgIsqJzmwXNEXnu5GEYTeD8e18LyvoV8JZOBDcnzdo7NS3eiByo5U2vo91EoZsBzR/kQ35pdGG55TS3aux0tAEc9c/QfJ8P4fyD9ikg== 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)(7416014)(376014)(1800799024)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z0NV3fsPhkqRQIfXskgBEphkl2zMJCosDKGBghYwvz7s+Rh6/eAc2K0eo4VfCRrdZlbeOj3k0y7xMpLwX9R0sRASHuSeH5xLy4URMPdCKFtNJ2cxUiDNvgB+Xg8Jg/fYPPg7gH0WmQKo2H/1/8vO+SQE83hfrqnOAUsnBzjb3Wzun+3Phb2APz34G26NRWXWpFq0FTTVxvc37jWggQzFI2CS0h2NdRcsGjJZIQ6kHC7uQFIz7eDmZ8IFwG+3qivcdtXZThx9ov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yJsdpovMUXyKm2PWuXhKNiYLH3DOO8bWfjuN9YzDu+Bs0CPfT4SO8HK5+d72AjIf6BsQx+S5SiCtzl3+tVMMllzq8LWZQvMT6xQrDI//Sivsy6v6/E7gswWCmtbjXpkzEGKhetBvbzm+wRLixpnEHrLVSeVcm0vl3g+wSKokv5aGHV0v+i2lTLbCu/EF1POT+aMxH7ZJyFzOdW5t7C4l50U5+hkst4Ka+uPkShfNF8l31p06z90MKQPoS/dOA88E61vaPAsRaqAN5cJavgFPsXzpTQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Z2z9nbA7/+vrgtoAXCHJhKwnxubioLjulJu8Vd/UGcbJKzdw8R4ZTpJW6nQ4t1JpFmDnk1VeoADSwuq58Uv4E28tvC0SOPOoHvzsTtIi2D77skflS6ELs7cnOoeEKAdreYUppQ5XhlyMJJBEJWDBoiTn/J7qNkPHp2Qy+cT2DKOXlNEkooGSHnPJg8PV9dojPfcVOylmvj1rp7DstR2bG7LzMfB5voH465xXTTnTvAZGzAjCuEPPYWxy9SqoLHXqFSPyX/wcPLmW+8cjioeOqevikEf+qTTZ9vHIh0IK6fiq4vUHpIaUJJIb/ISARKkSPiyb6b3I3sMOxBvKA8D1uPM4B2d9pbA7GBrcjFGvzq1/HQ7WNmXFYv423QSsLFs8cVTOwYCgUK3sapOR95PIUeVmDDUkAY1E+Grrqu0Q5wZPwBk+SN0hlcRh9UtCzQGN6SUOV3lGefZJuDiGQf52ZUiDdV1cettkporl+KO6y0mHiuRPqXuk5F4rhuAY4Vkt73hIbK/pl4Qj6+eRlvQMv27mWOEVuZhRSNetZmJINJiAXsxbCPEVgdWuhASC0v1xjOoO6VA9o7U6Gp+YlOQ2sntA/mWkFQfnsonIdX9AAg0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3993f67-2566-42ad-0cab-08dca69c1994 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 20:07:35.4887 (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: 57YsfsvxnY3Xcr44LgGMAFFFpDH9pazZ9hO9yK+dPJlChGbik0wwh6zK2DGDNX6FWyJxvAC07Cw8wZdjW7gzUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7303 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-07-17_15,2024-07-17_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2407170152 X-Proofpoint-GUID: wwNEHToBeP4Sd4mr0IdCfKDHLKEjCElI X-Proofpoint-ORIG-GUID: wwNEHToBeP4Sd4mr0IdCfKDHLKEjCElI X-Stat-Signature: 6n74wruoxirq5znfm7bj93oyuwb7mnjq X-Rspam-User: X-Rspamd-Queue-Id: B9EEA14001B X-Rspamd-Server: rspam02 X-HE-Tag: 1721246867-585920 X-HE-Meta: U2FsdGVkX1+snjlvLoedvle6jBap3kKdwNcwU2kxrzg8Sq6uOy7Yz6mZ4aNoU9euMKd158gXyNoQWb7EbpcKBGGMRW2MiKoLLRPOhUDHMtcKtm2qL1bjcMx7tY71+5dzZ19QATCg3ONSGKmN3Nffak5d4o7K4TV/3NceWJ8k3BGLnintIcdleToMmmpc0A7KhPO7ehNwnCLcUMWEm2fSkspLbprw0eP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iYRJDX4APMSoUnlWEjBagd5HJc4Tjaled06gXZ3B3vfj2Qce3AxxoWi2pA+sp2l9K7y8MWGBA64PG5OOi/kfQFvPdP1VCh8kWTREGrUY3GnWZxYHzwhE190Ky0+y+7lTOu5I/LoIuqGpqgz3TzcGFPc3N2c3BepS/k52CSGdJWMxhAAn+yU6k2lkNWc048gRpg3pP5P4+aQp5Hhz8= 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: From: "Liam R. Howlett" Adding support for a NULL vma means the init_vma_munmap() can be initialized for a less error-prone process when calling vms_complete_munmap_vmas() later on. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes --- mm/mmap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index a1544a68558e..722bcced0499 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -517,9 +517,14 @@ static inline void init_vma_munmap(struct vma_munmap_struct *vms, { vms->vmi = vmi; vms->vma = vma; - vms->mm = vma->vm_mm; - vms->start = start; - vms->end = end; + if (vma) { + vms->mm = vma->vm_mm; + vms->start = start; + vms->end = end; + } else { + vms->mm = NULL; + vms->start = vms->end = 0; + } vms->unlock = unlock; vms->uf = uf; vms->vma_count = 0; @@ -2950,11 +2955,11 @@ unsigned long mmap_region(struct file *file, unsigned long addr, /* Find the first overlapping VMA */ vma = vma_find(&vmi, end); + init_vma_munmap(&vms, &vmi, vma, addr, end, uf, /* unlock = */ false); if (vma) { mt_init_flags(&mt_detach, vmi.mas.tree->ma_flags & MT_FLAGS_LOCK_MASK); mt_on_stack(mt_detach); mas_init(&mas_detach, &mt_detach, /* addr = */ 0); - init_vma_munmap(&vms, &vmi, vma, addr, end, uf, /* unlock = */ false); /* Prepare to unmap any existing mapping in the area */ if (vms_gather_munmap_vmas(&vms, &mas_detach)) return -ENOMEM;