From patchwork Fri Aug 30 04:00:43 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: 13784291 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 42EB3CA0EE1 for ; Fri, 30 Aug 2024 05:29:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E4B96B00BB; Fri, 30 Aug 2024 01:29:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 793F58D0001; Fri, 30 Aug 2024 01:29:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E64B6B00BD; Fri, 30 Aug 2024 01:29:00 -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 3C7566B00BB for ; Fri, 30 Aug 2024 01:29:00 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9A6E7141473 for ; Fri, 30 Aug 2024 05:28:59 +0000 (UTC) X-FDA: 82507782798.12.AD397AC Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf14.hostedemail.com (Postfix) with ESMTP id 3298F10000D for ; Fri, 30 Aug 2024 05:28:56 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=AQjmBPQX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gfJWNYqg; arc=pass ("microsoft.com:s=arcselector10001:i=1"); 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; 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=1724995647; 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=INR2A1cBDUV4GAxtVOjXNUJPR3TPHjuX5sIyohpW8AI=; b=PemY3/TmC00kq8+1gkGxHkyYfoXNhG9eM0sjGM448mSjvzFPkATTUzbHQMnExySJwCCdoA A1yAnKwL24WMdkck0AgXERlc59v5lJgidUSBBQno2JfE09N9P9ay56umrx239zhKWzxzkk Ac5bnHZnSrEPeL3LaCvuBvq4NnAXw4Y= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724995647; a=rsa-sha256; cv=pass; b=kq48eBueNYklB3P/BygZF+BfoUSgb3Vgisqzc8HrNYXTUv/OOEe/ueKHIFhq52+7DtT/ef rWTHpgvi/Fs2ymwiJ10FfBOvsewVUE6TBq5/osT7SiQqAKxDb6HZ35fepIPYL6MoWE9SXU 8WC0jwnU3kKIUt3WWvU59f+ZxF6LNhY= ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=AQjmBPQX; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=gfJWNYqg; arc=pass ("microsoft.com:s=arcselector10001:i=1"); 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; dmarc=pass (policy=reject) header.from=oracle.com Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47U2uL9G019681; Fri, 30 Aug 2024 04:01:16 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=INR2A1cBDUV4GAxtVOjXNUJPR3TPHjuX5sIyohpW8AI=; b= AQjmBPQXpnbQBV8qZSKKb0F5gMq3c3RqIDjJuUwJtY9Jc8zWSqzrzmgq60sFkqUv DQTiyZoKTdg0tFsxWKxKG1jeWB6PKxAqtLxyvJmn8JGrG83S84WHEKtug+ogL0e5 CiCck/4YSwP7LiSU7eTiSiSv85xTB4309rkWQnp+IOmvV7HFArKACEpPldO9biol SVoqpv/dEDdtirhJRKTBFhzpBqk2ixUz/hf2DiRL4pimvBa4T8JPU4QB7QUJuAjU /TnvdfRC220S9zFeFxR2P+99ID23aE+A/c7RCM3aTFDtkZqqAtRQJ6StC5bhjGBk VdoIfsx50c2Om0JRBt4pTA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 419pugwrf5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 04:01:16 +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 47U1ZDJw031876; Fri, 30 Aug 2024 04:01:15 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2170.outbound.protection.outlook.com [104.47.56.170]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 418a0xj8bb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Aug 2024 04:01:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UIRIU8OIhCVS0o0GBPg60MfNCgmHafjhradbjClNoYTajyHVMTBz6vBgNtUzwroEDIuTPwrQ0jqvIdMlYwz2OifX4wbBhb8M0e05Isipm3cewdhhq7rU2q+5RIlpYS0bEKxx98FGrLWpJ+bawea1oVhKYNS+yxQYzgnHtPLRQafT/3A4StBR26Bjd6s7oI0wMMIcUPKP4DnIcd3bYT20AGZEqWIeqTP40LM+NIw+HGRx+m/NeBkyIpHGL4aju+CN00K8gClzfZ7/kG2hGRAQhRvmcACvm8Uc/34zz2VQvrrUh1vQh1wnpcgLmFABz8nA3KA7QJUSzs7OOomcnhXQqw== 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=INR2A1cBDUV4GAxtVOjXNUJPR3TPHjuX5sIyohpW8AI=; b=Kh+2W91I2zNTpdZeBi1cLszIzjGh9TEA83LWPtzDEbBlxWZBPb2vkDYNAOiF3cl6x3RUgr+fn58ZmZ2DeDkVa10loKQrEkKlkvhi3ok8gcqG/G9e6h2hzj4aKnaS9yJ7M8xnXc1xLWCcDedbu0FD9sAoJBhPRjCNVIRDv3oM3tfJnAZkur2+Q28Q8r5RGNfL2YnybC3TxgEdcmrJ3gqtluS0AYTk+kssz/6Q0C70vA85qLChbmYzbX2Zdx2zjyMrGo3SY5jTQntZ0WbvxXUVElKSAJc5Ez/cdox7cPu21junPPeF4NwgigM7xalqvMmMIpmGj8f2mjkPrnETK5CCaw== 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=INR2A1cBDUV4GAxtVOjXNUJPR3TPHjuX5sIyohpW8AI=; b=gfJWNYqgpZwI0YzjigOrS2fW1nelLWVbRxvSTeZKsQDpB1P+jelRsjswo1/WOeCEpUpR80ay50z/ClXrWcMLOkGu5S08BR9O0Z0yi/PXHe2t7AnyDQnozbGCGZ9KeM1q2OU3yC7y/JuqhXiM0oZeXyz/WYp2mQWr2slYfHmZemw= 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:12 +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:12 +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 03/21] mm/vma: Introduce vmi_complete_munmap_vmas() Date: Fri, 30 Aug 2024 00:00:43 -0400 Message-ID: <20240830040101.822209-4-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: YT4PR01CA0331.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10a::27) 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: e0359c68-95c1-4b87-fd1a-08dcc8a86333 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: spA5QsMnlwpTykoQjiU/HcKXFsVOPTNJLbVJgYBBIRrhLO9aqi0Xl6h/Iwr1E7TRbFDwxr+Wks7cMxTQz6oegCqS8Ejcvnsty8cBvgrEZLWZaMlviHrFrE6Is+7bNsxeKBiNIxzTH/ndehBkHZok2K+6egWeSffkVaSi9PNzt5Kl498Dk98q4Wr9TUlFotUrK5JqxwbuXPD9mi9N6GcFz/gp1SsnE+xusyEEL7703dLzvT+UAayL879aUe8JhNf6hJO2SUizON3X1s4AQUu3ngnZew3eK1DOZLGhMQUf+KuUT/Yi0dX1Mew9Z8HxYE6Mpg7mR26g5SCkSdbJ5zsueRn5pxtaNTjMAEwi8DDeTTW/BtT2OxaVDCe00Sh3B73sp8rkH9EgJZSh+N5lyJ7Lets57XHGrrUalXRWlVz05NBrs59m8o0D9ePvQh+mZbsdP5ZxBr0NqwA3u9lm7f+f406KGU43b6P2A/aMkg2YFhRIJWpkJTG4CxkMTXI0yoEsnAIL/hZ1BNTWJP1FqZvJGQC7ORmOZUfOB9opsk9oZZbAbV9WNTSAVNjagvluI7JpEG7Ek+9JErnV/eelYWfOfvgU1KqbSNHh106e4kXssUy7S9MSROe6epNChLqlC8nWnMMzsTlFlBblDk45Lkf6X16ovOXjzBzepZOpRERs/z7VN2lFD/8Ls/tJPbyH4reumwfL1PsfQlxscH0hzuDfvFMKjOys3OEc2qYzkEVGKBjjZNndF+E87HVHOPyTTrRjLZaMaf5bBPgVSF+BNDQFy/zuzpYm1IRE2gjSYm24dYB2jdpU+/j2jucfbmAMNyWjem38ZWDP0kAlMBy6OONS+J94KQow2kWS7pojG5ZoxiIqiMPj1g81jWzHlsk4SP1agFUm6fBw1CJEfnimhTUEcXo3+bUw6xcXHLUrNz8Iy6GdVVNLqLKrsRKDVvtDakRfwDiVJEZOyGOkSVDqUM+LRjN65o7nJBkOxA2fjpImdzBtKkQ6IC4ARtDon2FFnpnL/h2vG+qYUI/XAedFE4dpqZr2FwXDCso4xzB4Ebe4aVrS6tjkgK8ATKO6m66uslnQ5nUN1FhZR2FbanV0yKEUrRQKlrFUPYN0MHsQWG5wqWLpYJt4oflqnGyb9Z6CrdnGhntKbTbwemaVHGcIPBGuzHK7jGVOfe55WIYgS4EZRN2eHfxkM4ck63bGEvlcBjkuT0rzddELxi1qfeBr5lBc4lwL+Vluc6OKgaD2xodXX5N0II4IIId4ECJ/eNjnOjFRb8M00K0Ndt60luS1QU3d18lTZeN/96EAWLYVJwv8sPYe3js/7KdgniAlW7dDRhBC9KjohWuiKtYAd6P/rrB0Lw== 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: HIxW3ewT2VNYrK8RKE0IVO/cXRQd3H95VQ+jyhgNpsqUUkQFIwgfn7HEpE7qUpR002GjBtyMjnWvAd3E4lPJEJb+/Epv81uSJ0XVDGiLqaAcrky+DbO8bwvsyX3vtSVm+g6FzsT5OsUs803e0e5ibS57by4D2hpioKcE/phRbYlEDgEC7TNab6cFbUNfsgyjh2F1PjZl1hOIkN/XTebQQ+SQUL0Q6q8F3i7tdtWEmP0PUuDl9jPAM6Gwwkc2q7E0uPFZjAIY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O7anG2yF/qY7ckF504/TxGyCGtzOTaURoV+5Ojj2TsFsZysCRGfpUfuyBY1acNJekUNy5GYw6utzSzdPZ7uBNpSmoWdaf+4MhVQa807hG8sd3f7bvECrEYSR6HTsana7l5KkDdggRCa7WH6I7alilg1W7eQbXwaMw+o2+nK5BPCod+qlHVRN5xoX9Gz7KtUzgJFD9nc03Sb4fZdFQQsjzFdx4aFpQ5enBZVoy1T1d4CcX15lP4Vuqk6G8I9/S3kik+H6 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: a3LGdxkTbUhk1emIywXOVp1QlCdaBB8sL3iW4gAjS25VWF/5aybL9H1wFc0cMh1O/5Le6ZemXE5vR9IXWj7CwKwb1MO3OUz1+svD03IFUo2WSxlAbhx0tQrNFU1TTxP3tJ3m1iakvRI+xjDOSSAnlCtWOsSmaayHGqgLjgNr7u4HrokSbLFLkjFginVOkGfoIkm8rCqC98H2b0uC/cmcNbX3RBz/+lbWahxCpGHgRmyeRmV4kRgjCpgEVAygbNfLPlrc3TOZctwZyrOHeaMgOe1gGf663d8fFFPJtOtfKzhxlgjIvp2KZYhdcUgyrJW+xI0nS7QS/2uZ7Bvh4rfZSvgF+iyFf1L0S9JOKNv3FuPJ1dTXRku5q+VG9KnXtKZj8kCfsG+hwX5/daKIzx6HFwZvpzpvFB8/tOlUyD+n0RVjHUU7tukuzZp++hXxX0/c+h6E2DOdPZ9AvEWlS6tGFkPs0PF3IaNOgB98tfTPtSVxXQgO0mU0WY2iN3uFyaXDTLkE48nGcYG3WGCnwhFZOFpkep46sBFTiKw8m8aCBP5p0yasydX2UTSARBRzGx4vD+gr7E9n4aQELfiAkI18ZU/zwtVJbseO8fSYQgQ/Wo4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0359c68-95c1-4b87-fd1a-08dcc8a86333 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:12.5056 (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: vzZ3R1P9HMI3La9JRZCLl0AUhfJrDGwsDCVlLMiznT7yfdwGOsc7HJ5e09mhJSbru6/vCM9rTnb7QltLcL+bjw== 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: DtnEtIF7t-cLM6Qf9quFrHcgnz4hQKEE X-Proofpoint-ORIG-GUID: DtnEtIF7t-cLM6Qf9quFrHcgnz4hQKEE X-Rspamd-Queue-Id: 3298F10000D X-Stat-Signature: 8j56geprh3e74pd7m48a1j5q7susugud X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1724995736-182536 X-HE-Meta: U2FsdGVkX19ZXkwrceQlR5vX9Y1iJoAJkSSvJsUcrjmbIkxyfy3tmFvpmhR2Fyvp5a6LhDL2CkEBtve7q7DU+8r138hLyIWoRMkttPWfRhrmHsiv2HuXVCLoyv3TpCPDxmybImqIu4c0JcFzhugdDGdFfLMUjihsXf/UuTHMDpZ9dmKhSYGocVNmpPTaLkH3teMluWO8HyjCzfQTnbIwcM52nDWxmfoTY+VshMXFm+DkXNgBFl55r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eibgjecACp44SrqsoqEh4mKyGGwEdmMHuvB+mHC8VfBwsvgU8DrrqoGmL/8Pch71wGPtWC6CR73C0Uu31P7avlBxAT/lhRo2qFCFElxqWlj3C/kKusJxyfrP5+rzOA3lqfqctiuAgqSq3vlYMuTM8/Xa/MO3cEmuiMbulzCpaGFdQifxxT5+xMFo3y/k46rQetSgEwbjp0faW3cDzNeErgrblXTIUVy6fJ+PdWFy6lRLGTu8LvQYmiv9VdeM1g== 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 all necessary operations that need to be completed after the vma maple tree is updated from a munmap() operation. Extracting this makes the later patch in the series easier to understand. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes Reviewed-by: Suren Baghdasaryan --- mm/vma.c | 80 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 25 deletions(-) diff --git a/mm/vma.c b/mm/vma.c index 58ecd447670d..3a2098464b8f 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -684,6 +684,58 @@ static inline void abort_munmap_vmas(struct ma_state *mas_detach) __mt_destroy(mas_detach->tree); } +/* + * vmi_complete_munmap_vmas() - Finish the munmap() operation + * @vmi: The vma iterator + * @vma: The first vma to be munmapped + * @mm: The mm struct + * @start: The start address + * @end: The end address + * @unlock: Unlock the mm or not + * @mas_detach: them maple state of the detached vma maple tree + * @locked_vm: The locked_vm count in the detached vmas + * + * This function updates the mm_struct, unmaps the region, frees the resources + * used for the munmap() and may downgrade the lock - if requested. Everything + * needed to be done once the vma maple tree is updated. + */ +static void +vmi_complete_munmap_vmas(struct vma_iterator *vmi, struct vm_area_struct *vma, + struct mm_struct *mm, unsigned long start, unsigned long end, + bool unlock, struct ma_state *mas_detach, + unsigned long locked_vm) +{ + struct vm_area_struct *prev, *next; + int count; + + count = mas_detach->index + 1; + mm->map_count -= count; + mm->locked_vm -= locked_vm; + if (unlock) + mmap_write_downgrade(mm); + + prev = vma_iter_prev_range(vmi); + next = vma_next(vmi); + if (next) + vma_iter_prev_range(vmi); + + /* + * We can free page tables without write-locking mmap_lock because VMAs + * were isolated before we downgraded mmap_lock. + */ + mas_set(mas_detach, 1); + unmap_region(mm, mas_detach, vma, prev, next, start, end, count, + !unlock); + /* Statistics and freeing VMAs */ + mas_set(mas_detach, 0); + remove_mt(mm, mas_detach); + validate_mm(mm); + if (unlock) + mmap_read_unlock(mm); + + __mt_destroy(mas_detach->tree); +} + /* * do_vmi_align_munmap() - munmap the aligned region from @start to @end. * @vmi: The vma iterator @@ -703,7 +755,7 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, struct mm_struct *mm, unsigned long start, unsigned long end, struct list_head *uf, bool unlock) { - struct vm_area_struct *prev, *next = NULL; + struct vm_area_struct *next = NULL; struct maple_tree mt_detach; int count = 0; int error = -ENOMEM; @@ -818,31 +870,9 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, goto clear_tree_failed; /* Point of no return */ - mm->locked_vm -= locked_vm; - mm->map_count -= count; - if (unlock) - mmap_write_downgrade(mm); - - prev = vma_iter_prev_range(vmi); - next = vma_next(vmi); - if (next) - vma_iter_prev_range(vmi); - - /* - * We can free page tables without write-locking mmap_lock because VMAs - * were isolated before we downgraded mmap_lock. - */ - mas_set(&mas_detach, 1); - unmap_region(mm, &mas_detach, vma, prev, next, start, end, count, - !unlock); - /* Statistics and freeing VMAs */ - mas_set(&mas_detach, 0); - remove_mt(mm, &mas_detach); - validate_mm(mm); - if (unlock) - mmap_read_unlock(mm); + vmi_complete_munmap_vmas(vmi, vma, mm, start, end, unlock, &mas_detach, + locked_vm); - __mt_destroy(&mt_detach); return 0; modify_vma_failed: