From patchwork Thu Aug 22 19:25:24 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: 13774109 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 D25ABC3DA4A for ; Thu, 22 Aug 2024 19:26:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2BD928004E; Thu, 22 Aug 2024 15:26:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26C4A80049; Thu, 22 Aug 2024 15:26:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0710B8004E; Thu, 22 Aug 2024 15:26:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id DADC880049 for ; Thu, 22 Aug 2024 15:26:22 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4BD60121037 for ; Thu, 22 Aug 2024 19:26:22 +0000 (UTC) X-FDA: 82480862604.10.902384D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf21.hostedemail.com (Postfix) with ESMTP id D92CE1C001D for ; Thu, 22 Aug 2024 19:26:18 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=gKQ8utzl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qjM7W4vq; spf=pass (imf21.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.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=1724354738; a=rsa-sha256; cv=pass; b=FupyqOjvk6h3Ghob+KUdClUjC9ZYJ6YwH6jgeqtC0i1sRbvhkBSCIwuPY0D89l3vPl7TjR yk2U50B101DAd0YHDDSpVQ246aAOnDJRSAZDw2BDrB1bhdZ1YiBWhVc+4ri+xn3FGMOiTK Jb6x59F71iwfNc+/GG1jFyFlY/+yVEc= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=gKQ8utzl; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=qjM7W4vq; spf=pass (imf21.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.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=1724354738; 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=n75tVTS53cBeBbIpWtfM0sdVDQahCbDm0wo75/GP5Jq1/Y3u7YZeOl0rREjkNQfkZEUx8g m8jG2ncl8Ot0fIBWxq8nZCTWyl0ipok1XvuIwrIuWQlqqq4j6D8bMWV8lz8T2p3akVn12z 00TOfrfaFhqtlbIrVMSxrovd/G8aCpk= Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47MIMWus029723; Thu, 22 Aug 2024 19:26:09 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= gKQ8utzlvjAp7q/BXzx6kIa/c8Y+gl431/Q/QT6iHmgi5C3CuW98YVjF49dgPQ1g 7GCnTe+C89NyB7AlL2muRv8oqhS06nWO0H2fcIfCqvDX20v6CSEtw2yHw3NH4OJO 3iv+SHeiLK8UbtDrCR2o8FoA8/cF+wgfE+6mZmWqGpiFPNi8oeQfLWKmicZqlLrl VKw3BaNko9hf0pfiUYbQmldCl9Egv3Y77xCpEJfj4RDtSHu/QGI6IXwKToBL4OSr VtPVdnWriuXMfwceTY9mUubPgEUdaLEvRQlokJ34YBcUxMK1PZwgGpJzx4kG4Bsu yu+PtoIFjVF8L425CoJlIQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 412m67jrq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:09 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47MJJBvd028114; Thu, 22 Aug 2024 19:26:08 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 416bct87dg-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o/5RILsvsbkzSgFGAvLWuaqrqWSAo7zjJHWVfT2AECMZEIY/GusFJcRv1A++qJ6LCHPeAHCACas0u8Qc6TQUscu822L+p5vUB1DIbJPDLx+sQt1LQa9tm/sHh3+T+6T+ShVLpChEXp8tkarPr+VkRH0q6QxCGBEy4wLnpMiU14iqpR7kF0AEryp4gXLYm36KO+46zc/aprgJpyQXJfbBb+OLoFUybXcdvdIpUZgGJNxo6FvXP8TvT3DktFTC6mLnuxOQHWnWH2fEcJvnguAFGY/7GQFK5nl55nxmyaMlTZ0c7XeS502rb3Odud+slO1bsmJIvGMeV7jyL4eUKuxG7A== 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=b67s7NdNglawLPDU+XXY15wLMiWKPIRtZijQzf4p0RPqo8CrXNg3iGhu9QxQCuW3BpE1vbnwNYkHcpYUWPjw4OMjWRGYqrk5pFzqRxh+TmcLBd9JAtIzZcZ2lDolMyiQMqjdQvzWMgFdlnKbIerAmXg3AkbROjQxP5a2OzCEeqbcH6E42bVPkReETJYv0+WX/M03bW0LlXO30CcvHwea1c0JdnL8Yh9Vlhg3QAWJYRPYr8zkckuqeHYtRMwmhElhBYWXdlK5XbLSY50qLJLP4t/8dctSjDuP5CQX4jddBvl4mjhWEQ17vAoQVg8xSrlQmlHIU5d8pO5HEdJRiF2vGQ== 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=qjM7W4vqgKe2obWs4ZKZXwX6FRdhrcovjRMUXtz/2KMRpZ5my5PlefUxfXtTEoyep9zquE1JMmszgue075NiGE5TINcc7Kkwww+Ng6maTNQRPUPJrt7l8oAA6NkZ3FBybDQSQQgb0zXRFDr4oi9cpM4WMVpUJ8NFoD6xbsEgvLI= 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:06 +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:26:06 +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" , "Liam R . Howlett" Subject: [PATCH v7 02/21] mm/vma: Introduce abort_munmap_vmas() Date: Thu, 22 Aug 2024 15:25:24 -0400 Message-ID: <20240822192543.3359552-3-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240822192543.3359552-1-Liam.Howlett@oracle.com> References: <20240822192543.3359552-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0210.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ad::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_|CH3PR10MB7356:EE_ X-MS-Office365-Filtering-Correlation-Id: c1b148ec-7f5d-484c-565c-08dcc2e043ec 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: xTv0v7D9RIzdzqhD6DGwmbwTb91fnz8kk0oBaOOgJDMBK2ub9Hg+goUVkupfM4gPmmCTQ6M1u/iPIx6fc+ztjWexrQ+OPPxWt/rghGU3sqTVtO1mSxKEDXLpx+RNT6OD7BoEACUWY31ssvizPFfKX6he9cbBb5ktFO0n0EADm1w2mDXL0sLS7Ok7/uk37J+iujTRozwr+f5TwYDNLns74ydls3PMJpW8pWXY17RDb4pOg8396SHBQ8J2DVt4tzXL6AhPxi0iqgOwJPB4RUTCx6C2ywwmbDKLJzQNYNVCztKuOeYDli9GgifNXa0qbG682iFGBzyI8RTBxwUkuDLVowmZnSVMe/CEckyctTK6OeXvDYPo3beq+Q6qH+SIHD6uHUxJ4zLCtMbxBShPScJlMzucOKHAndzeWGt9iepKVZ0F+PS2HfAG9mHUh+gKjiLcS9V3VFqNUIWEAIcAZmzbdrCNFSOyYxiR7KmSCqhFZ4JXg05JWas3WYaatf92CxTXFG8P2j+4PmTBSDYREivoPUNEK1ru9rA796F5N3eXvN5Z6Tc2a9+E2wiJPzr7kQOsDQkwiVAdUG5MoyqqwxcJ+rRT2mg/MHNEJ8ILY3lQv8z64d9L4Avo/a9rQ0eUKmMSroFSMdHgdENGWrm2L4UqF18Z9ZBo3YtAjGEOAWRLlzBfcou+mAVrG/jU4/8pK5DLRMTMHVrO561W9uL0kEx7xMLs/rojmbsANiHOVYrMp3GpMVHajObbO3wPgtoO3w/oa3JAcJvSo9mofBfQLULuiUrNxXAVe+XcUNhlW1KjymHsHfNceWYmUXWv+kuSOOBVXRsj0eAxdbHLkFE3Z/CKfTtLBcPtyFFvwDZVBKKSdJXkvLCGBfXsbH5qcyAWWnsLbUFTnU7QsvSR9Uwq9jd4v79wOsLcGdh3kWI3pUp9esDFn9oFNin49izqqacojJMSYHIn7sjrUAIFqfXkTiDx6mqyQh1NnQIkDoLn9UrCwbpipuOZruiFBDPUy9Hvv/WB1PgxaDBjXlEbZU0UZSVNfE3mVFv4pQJPsoSrUjINkhOtwcmPEOnWpRR3475ao2LnwDd6s+/HELWSoITSqGiItlHR9IEdCxw+5IKf2ewwGb0tU2aOCxE5GPI8eKimqq4jZ66sazkd0M3eRXkyE4br4Z96OCQbKgx6bO0qE/BoUn0OfatFGHQpbJMWS2cGzrOApZbOli/JFhz568L2XrnQvJeCIAmmePOrVWIS0f1RFHfzMtFLpmvpVQxPnc3RoEf5vKbGCH/NCHR/QILrtjSTmJzu0XYG03Uzd0+n0BmoBn6OH0pbueX2/gEg1VHEt8TB2jW3E1kbW8W+6yKhaw9rew== 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: wO2xlB8Wa4SFdAKRQzSo+Fe8oajBTtu6YDdihygTnV0Mwccjy+0VCwI5ozchMl8TNIyyYLipqL0pR5Cyam95M6pE3C55f6X8QFoU32oqI3TEClpqTh3R0ulSjtuKz0A8vqOCA7AJAEB5qwVZKvZp7PgFyw3dr9cJSgTVoA4xHtCZ99TVOU81/URVzUaAXlfJTBcoqRFVDrc2h5u4Zprjk8oOp8ubDxG/zr8PAyt5Zxdr/GIgDSdMsrFHF7E65WxJXFDOAERfqYc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K8GKnfAIcTqoPhdVSn8u3TTBhkVuP2rezJRJFLa16oph9HJ9d94CHJHpo+b/CiVdMWLnzvtMRPH9uOrXMdv21H8Nhyj9wmgGIuIZXAH+NbhAEP0OtvEb7oCo3qka8L4zSVx7q5Uw91bucNlwollVLUr4EN/FWXYW/iclKKkmgTEjP+P40YKYcvXo6uChHRCvy3n3TZ9pR8JP3jYhygfFWWFea7+7CiXN6vU5Wtw/z3zbjP0JOLQatHOADp5tnhERy3mNXeaquRrQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: soKAiaZhohOoEd+jemYB+9M4civjdqm9PowouiAddtMFYPQPaSjjsCxyJRdRkBri3IvMt/MmRSFocpPCF0OdtXns3nQDpABTkfwsK2zQttUqh6PYXlA9dJY+p7nT6S4HMA7q6NVi5eiSW+wflCy4uEgvgoKDyFTUJWJlwU5heaWqIpyIwIZNDJ6GMg0Zs4k3u45tCSsjy9IMpVJwlXkCblDGtbCuIJQLlI+3fZ42zM9ya4lP4YRe42gChoGp02KfEpjFUazsUW8fpU399xyBzur1iDzAQIvKOFCwLxi72b7XL2Xs1kdjR6E4/3nreZz0R+xghQqYs76EKcYmn4clXuq/IibJiACZ94BkT9k/kVWoI/QSGrGO961mIR/wLI2gRgpQzAfZKkQNKlZfmK3RHh+rI13vRt1kyEUZkUaPeCkmKNnAccNkBk6oo1uyGskCrx2OMnK0VGEP2aByin53vR+1L8Nc34CSO/3O5yARcf49QGXq4acaLcyWFll14DQeBwc5zhnAXp8FfoDidoF1bzRiVMR6NPINGnXSxkORW5/y2fEcSnJVmGyRAS1J6kfm9xA9RUvsn3QyjrwYqIHBa1kvDcVNPTY8iovyFSkx5P8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1b148ec-7f5d-484c-565c-08dcc2e043ec 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:26:05.7147 (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: PbejhqFJ5G62Ya5rg1btcmSORiq8rBW2Po7iRwGFCizdf7seSvwRMVRA5MKj+UdxK3ixZ3/u49TvvstdCM9U+Q== 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 adultscore=0 spamscore=0 bulkscore=0 malwarescore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408220146 X-Proofpoint-ORIG-GUID: qO4n_krSUpo-SGONhQuPymv_sdg4C2do X-Proofpoint-GUID: qO4n_krSUpo-SGONhQuPymv_sdg4C2do X-Stat-Signature: xn41ozybnzgyni1hqb65w95cgaoiremc X-Rspamd-Queue-Id: D92CE1C001D X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724354778-678433 X-HE-Meta: U2FsdGVkX1+Vor7Y962nZUTggZEY4g98/0ZjQhgYuRq8qmEu9oThOAKYMGyuLc0Iw3FeDsF7Z0eRG09GqRFs5NEaETTJH2PAe2Z9YDKLMHlDTV2WGtaat2lp0h/UcuG2QpJAzKM9g5GxZhuVtDpy7iA4i0LuASXMlMzbvMVa4dhVqBn5IrSfjcatzvy8ZapZHW+CkQl50de07Uef7Dh3O1GuYQDUPrUybQzogFW6vVVinJIIMqLBix7QjWxIFFoNWby7hWn1y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IVP2owSt2HZd1JPW3cq3Lfk6wMC2AAqG0znM42NnXm5Dpp9JScu2LfmQG9YOkMDy5y54lDQ4OH2NWw+FyQzrIuciyvuEO2ycuj+NcVHamykYjXC8pWxYWPErlmmdqdL7oK5JlYn9VubfjDNIQ53P/qNSZfTc8CeueplNu9sx7Dz00VWAlxa1GMrMqH/KXOe 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);