From patchwork Fri Aug 30 04:00:42 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: 13784182 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 7F268CA0EDA for ; Fri, 30 Aug 2024 04:01:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30B486B008C; Fri, 30 Aug 2024 00:01:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 29D8E6B008A; Fri, 30 Aug 2024 00:01:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 019FB6B008A; Fri, 30 Aug 2024 00:01:25 -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 D97576B0088 for ; Fri, 30 Aug 2024 00:01:25 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8AF5D1A070D for ; Fri, 30 Aug 2024 04:01:25 +0000 (UTC) X-FDA: 82507562130.24.1199341 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 3539A40006 for ; Fri, 30 Aug 2024 04:01:22 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=eC9zapJv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OIwSSGNT; spf=pass (imf11.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=1724990437; 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=WZRaFvqKhmeZGOgIn0cNM+Fo1hKAtKZhH+jC5oCYViw=; b=5JxiFe4/y5ks7yVsrhKE0QHduoawmB6OjE3uwwcM5AHaHEym8J56WOFH5lJziLH19O+ZMk 5MXTBTAkyg5KCXHgys+dY/VAg4oPlGpyqGapkkCrLreMImSNBS+2e4CENGAd7F0XeioiQl E4W4G+n7g6KRqjLkdpcMR5lbEMIYvY4= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=eC9zapJv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OIwSSGNT; spf=pass (imf11.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=1724990437; a=rsa-sha256; cv=pass; b=vM/e2EtOpYmVp9TQq07ovoj699zDCql47JcL63+uxtC8y1HO83GnwwQnGz3X0trV+TUVoQ vXbrq/TQ1lFLW4507jKJdZskPvzEUHSt9cFESFmrjQerLYkIb34gIuaqtGR9MZw3QekXLk +oprJhjnbasYp274Ig9peIMkBI80L84= 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 47U2fiFW001321; Fri, 30 Aug 2024 04:01:13 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=WZRaFvqKhmeZGOgIn0cNM+Fo1hKAtKZhH+jC5oCYViw=; b= eC9zapJvxyW3cugG2HVSrnuBJ6J5m68xK8kCdiDrbfV1hohw4vMmlLNkYaSMXCuG gyHj4ilkSr7fLDLKng16e27hCSSDBXw3c+fvxZJr+4y1hUqsu42TbvpXDP8Rx2qd KhSGCG3WqDzIpY/kui4fpFevlcMorojgPjBI0QlZWzM7ijl+yC5orvFmYHeMlnz5 3XiX+6cP+53cW8KHZS8oYjrL9wgI2N9PoepiXXMjrTMNMHELCX30AFLpqeEjVCGp ia177EqKs4/ckE92XMCHlcB4D9ivmqlUPraLQqu8l6S8MREkiJhTya6Vr4x4nrOl fP5UKA51w1U00s+l0VgGhA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41b25qg882-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 04:01:13 +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 47U0URNe032483; Fri, 30 Aug 2024 04:01:13 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 418a0xj8a0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 04:01:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xFnQqHYNEiXLZ+XpXpRWAa4icArX9Y7CDlrIgiLC70cL8siW+JwQPzAvUslgxLtXHfW3/M/4LUvULEdB0uaqP5UI7kp8JLaPTKUj81PyObrMghmxMMG9UCxK4hFHsjlqUcZqHvuVAkhDCMD81S0zumfLfRpA3PgRHKpXPrSYw/vhFgNxvtS1b2HAmp4DSqhrxZp3jCGONlXzVraNln+s5Ci755pvAIi6raTUqTGBx+fYWuWxi8wdBT1pR21KPCrZ0SzYIgYF1dsabYGX4PCqOIqvAP3VunvFiZSknbIdXVe4vAQ/1JXyaEGhLHp2rWwtiqP+f/C61GULc9+QgVXGRg== 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=WZRaFvqKhmeZGOgIn0cNM+Fo1hKAtKZhH+jC5oCYViw=; b=O/2bRHgXXdT7Y747TvCV5GpUh2FYnZa0t2yl3lipRDdvlGd6Wkx/drC2XJpVpOGTg8RHoP0RmJz54qsPBIzNXhy7mCda9Gr3MEYbF6kSTr8joVOM973v5yCQ7/eH5eiXJALNEO6xZoaq6/lMTIqa1E9nGl+7U1ezQGng/ZDFiyadJ4KQqx4PunD62yvhyJiGXerxpjgTv9gMQAEqh5uC24Bpkjx9GLe/0T7ya1iT3ky9blJRoI/sytIHxeSB6lemwThIu0D6rUBzSPnCvf1rTXRXb54pCHcbYRMphJUp6ltnpOL1ESiyJjuK5WAO4Gu2KiFCv932vypWy4ghnyBR+Q== 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=WZRaFvqKhmeZGOgIn0cNM+Fo1hKAtKZhH+jC5oCYViw=; b=OIwSSGNTN8NtAmSI/XdH4HeUbYJe9By5V64xPS3Ixx3EXCOGucJ00QsIBnDmrFN9LE/P5FhAFsvn/3Q8nD/lpZQ73Vg+xodc9EynkWs0x3uP9u9oMh7rKPqzV4GYAXpRXd9PjwiLh66QuftRjAeNHd8qAw1C/Bepc3kPUsLL/X4= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CYXPR10MB7949.namprd10.prod.outlook.com (2603:10b6:930:e3::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Fri, 30 Aug 2024 04:01:10 +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.7918.019; Fri, 30 Aug 2024 04:01:10 +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" , Jeff Xu , "Liam R. Howlett" , "Liam R . Howlett" Subject: [PATCH v8 02/21] mm/vma: Introduce abort_munmap_vmas() Date: Fri, 30 Aug 2024 00:00:42 -0400 Message-ID: <20240830040101.822209-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240830040101.822209-1-Liam.Howlett@oracle.com> References: <20240830040101.822209-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0057.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:111::13) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|CYXPR10MB7949:EE_ X-MS-Office365-Filtering-Correlation-Id: 5906c6d6-d9c7-490f-cad7-08dcc8a861a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016; X-Microsoft-Antispam-Message-Info: pSBls0z6fsGqUQzyVkFUnFpiFrIEgb+l1SmFKMP+vxuV7K679DBrlmcRBYbTStnzlKm1MI3P+wxX3gcCapZIG7TBrlshAQIyvJz0EAkoyL8VUCo7zwU6EpbNKSkdSTjSg8zgd+yK6Fqf/WK8BG4tDF0Hkp2dKWXyH5pZUTPYr5yPDPCHxamO3NIHLA2XySuo0P8EH/F3laib3Miw5fVoFacOjE9BEnvkRJHQ+rea9dm7xKDJsnDC75NurIEYNdu3IcsEsUIzk/S+AxYOPVWrS5UM24AKFnYO5dNRXSTI4qROzLPAujlxla7KD4e3cPRtVvvR8M2O+Zg3hDDHkFlC+RTu13IKbdcyd+u9HXOMRTFn4AxaRzsP037VtJYbvzB0fQbdWKK04+KKSfiirL7kl4/VJhw1zXk90InDH5jr74JgZr0jzwH8N1sCJ1wSZa/53kWBDgM67XqzQLGoKp0upff7fis1Hk5VNzHUJAihqMDdU5HW8nAowuh+iIj4DxBppgWT5o/1Oq6AMwW25gP7cpUolkpdqI1E+Sq2/yVeExiOxr06bzEokGU0FmEp8KXVZrSrHM3XtiJya2Pq0ysOe4GxTrxsgk6VIJIPTERqqiG9Q7Pm8gkNIQ3GI8FFMwi6R//auGhY50MwUGkGCN73rhKctmVGkdSfW56Ah5fZ3SNd11TQNu9ubYLzetV1dYaFoMnzvYK6iNF1F92r7I8KgRPcu4KPo4i9BIthV49lrsUXU5Ol9zkM4JUijjIbdlSYSUCCSA2KLTfCdwqUAAExGvy/J5y8roTSXfuCHx38dNJ/3DPEcne5KKhlFJ5o2j08Gb7QOdeL7pUK8B4niaz/9lCADaDoHuNc+K0YYrKr2Q9F025lM9UXawmaA4jTh9J1yuj6LoQMzfw+XJ4aa+lFl1l5rK38KfPhN2Hg8FbzV4AfZCIklbpfSMLcEEHueAeIEdLzIwXICFEq0dbRGzy6LVkCQQI1k6lDa79tfWz8dsCGRyxCX0v5yZTDOCH4NdkL/DjbOSnPZ9MQWoVf9NR52xeCc8y35f5nMKxQSVdu+Tfbn5+M5YgxU3eNmV77vJAr27jpKcCTK2AP60Fi2ZZU2xY2TVUBWZon1fYifHFZgmHjUNo5fOPmMTTWFPRMZOYXlH5gH7B9XuD8Hgme4d/kMvUXtD8qXDwKWerZP+Y+GgfjvxoeNOY6VyCf9xBsiHsF6jh4rj/VwTqlYUulsEWDJ+UwTYBmXeyxbGHwlka1cZ3gvsA20sbdrTMLu1NnEhuB6KJomJqZnGIz3MercGiZLgE4eL8zeiMkItNKVj45Xw1MIt1Xo5ZylyjxlTkIRzQ78SSl9F55H4OVi8SMRDglnw== 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)(1800799024)(376014)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J0yCsSBYJfGuPp5iE2ASZdEsEfVSUvPo70gzw7JTvGiBuL2unqdHok7cSCukVKTQLYBDbWlmPJDwL/FZcMkeuL2GUvXAOrNkx+AeGSvvHX1JYqiyLapmYkpVmFa/NbTFzABcI0EMzKkGyf6/Y7tcueieENhUfqsnHiV8/ZSWmqn1CnB66qsATD4mfjDUps9K07jbbIUvVqYgjQ/5ajGgEl8btQUmdwXVpclesoBBFWAUypDZjuvGuRVdaIv9Rjxhs1sWT5sVw5AijEH9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DuAqYDQCX8GymRCexuGlYJSht9W+8fHu1bqUVvOUU35fvlMmQ5JO5w/3TvdXvisb4CKDMfc6IZn0Q7Q7Nt5OvAduzANvMEGhB/Izhi09uRKjrSgen3ZqIafkf+EZhK4st25Jw5POfawDiOxZdbYdxMly71E4szGzR8fGNh896RaxNHZmbm4kcjqibI/qYOz0zoEWAfYpch0Tqn7L7Ax786wd9VjnYNe5mcvvEQC/9HhCDTRsZAyND X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ez4DOe9DlIf4igwCLTDkxB9OGUcTimFVqt0aoZ3AW8DhUpjZaqv7uFRUNpkmoDutUqYrl3G9dfMvxTbJNAw9s9RJiXyOKOqh9Lj32LK3ot0xx4bJh7YxE8aCsb/kpwZPKqDayPH8FdF2b7eXehg9mubi0RQA0DhJ1Wbwq0S8tFo1KSvrSOK/Yz2E2nqW+MtlbtpCJev+TsKpjVv12RXV4Y3ohfZu+vI+7Qmqe29clIHQMgWdoDKkliiwZaA/YIDVPoCpp+0a17rqHSWTrmDPi5gFClzo6Jgc0CR/mrAnyZ9ZiZ8l64Vvp2ZWALiJgQ2TRRxBhjaqf2c+6+EEPVt4e/B1WUBDKwE2uNsOSRmUeGT/icKZgltXbLqY5cI0MMv3uF2ZbOI9yZw2iMvXCbE4krN+qLjAnh3nAu4rgoNp2W3cojjEpg0AIwrivaghvPYL34E9oHCPNBj0+ZdWQUQ0FI5Ns2XPiNrm1ChCZsMp0znrZNdcHVHg5p7EO6c6lULt+ODyRpcU+UhES/VsWU1SfOuiwcHbODXfKv/vtjgDBT6Vzn+tWE3ZP4irhboI55W8uR4sr3urM8IYGWV+gqlZ7soQ+RBlID0A1LuLY/Xorvs= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5906c6d6-d9c7-490f-cad7-08dcc8a861a9 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 04:01:09.9452 (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: KF2yrXvr+qwy8QC0lm/7KWQv58v43QT0K6MmHMERigokz3rLx2+ProXNKZdwh9j50iGLiLrG0T7sNQapS7mllw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR10MB7949 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-30_02,2024-08-29_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408300028 X-Proofpoint-GUID: 08MpBUmu_sHQCXsvpvdvRka9Xf9--INf X-Proofpoint-ORIG-GUID: 08MpBUmu_sHQCXsvpvdvRka9Xf9--INf X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 3539A40006 X-Stat-Signature: wh46ep1xkj37r53wsxximdxarqs9rrnb X-HE-Tag: 1724990482-2708 X-HE-Meta: U2FsdGVkX1/SX0bsM2x9bWM/dWLp3yaPiTSfQesKinMLkH9xdYQ8ad9ECP3XLkIjBfkquKXiQbHdTgq4YSJN/QIx5TRc49zB2y5E2U5i2XJrUnlvfbIZcBAX8t5pFDaWHykXITqGwMxU6kWOc7kY9Gqg4GmIbvEdkThPwxSq4WsVoEwwYAPZ0n32qthrXWLE5XHbm7lG1vhsdrDk8IECvfMzipHqYXMzHj0wTdOY5+GDnZgo5NPesSYw8w7Fg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Fxu5ScscytujA77KnQSKCi0IiB29dKZg13YWAMUnSKFAY82vWGmC7PkIiOfz+TgiO1jnlW3s6wbdOaKHaBt+nAUSmXU2eEiB+j3Gy75yYFZw3692wfGb02tyNF0V2AMpNR7yrpELaT+dy6li3DzqDmd/aLgy9dDNUpBtPpwytPXNugbxBQ9ztUYBFLeKp9h9SPnpPr5SqwnWyyL29qral3MVOjtvMA9Cyy6eGrTVlFYiEfDeYkOURM9Pm5ANjhAfhmUDw== 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" Extract clean up of failed munmap() operations from do_vmi_align_munmap(). This simplifies later patches in the series. It is worth noting that the mas_for_each() loop now has a different upper limit. This should not change the number of vmas visited for reattaching to the main vma tree (mm_mt), as all vmas are reattached in both scenarios. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes Reviewed-by: Suren Baghdasaryan --- mm/vma.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mm/vma.c b/mm/vma.c index 066de79b7b73..58ecd447670d 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -668,6 +668,22 @@ void vma_complete(struct vma_prepare *vp, validate_mm(mm); } +/* + * abort_munmap_vmas - Undo any munmap work and free resources + * + * Reattach any detached vmas and free up the maple tree used to track the vmas. + */ +static inline void abort_munmap_vmas(struct ma_state *mas_detach) +{ + struct vm_area_struct *vma; + + mas_set(mas_detach, 0); + mas_for_each(mas_detach, vma, ULONG_MAX) + vma_mark_detached(vma, false); + + __mt_destroy(mas_detach->tree); +} + /* * do_vmi_align_munmap() - munmap the aligned region from @start to @end. * @vmi: The vma iterator @@ -834,11 +850,7 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, userfaultfd_error: munmap_gather_failed: end_split_failed: - mas_set(&mas_detach, 0); - mas_for_each(&mas_detach, next, end) - vma_mark_detached(next, false); - - __mt_destroy(&mt_detach); + abort_munmap_vmas(&mas_detach); start_split_failed: map_count_exceeded: validate_mm(mm);