From patchwork Tue Jun 25 19:11:39 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: 13711864 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 9F1EBC2BBCA for ; Tue, 25 Jun 2024 19:12:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 95A496B00B9; Tue, 25 Jun 2024 15:12:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8D6C76B00BA; Tue, 25 Jun 2024 15:12:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E05B6B00B8; Tue, 25 Jun 2024 15:12:26 -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 47B566B00B8 for ; Tue, 25 Jun 2024 15:12:26 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 04930160539 for ; Tue, 25 Jun 2024 19:12:25 +0000 (UTC) X-FDA: 82270357092.08.F0999B5 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf10.hostedemail.com (Postfix) with ESMTP id A1BF4C0008 for ; Tue, 25 Jun 2024 19:12:22 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=DqO1J6Ih; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bRfITZgs; spf=pass (imf10.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=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1719342734; a=rsa-sha256; cv=pass; b=Gi6W/snlz3Wp07NChXCyoTw2q0SJdneA2czxFFlU0MX4ITf0Jo/K5TnENzIkHQ0p1T2OlS kTjk/HFIp89Yw7mbd0Jv0UKioPHY6F9hE+NiFcxOdDoybmM+edcpMn7OSfZtlU6IhRNEmV PudGu5dOSsJbkLAtqzYFWB0XbIPFOVk= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=DqO1J6Ih; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=bRfITZgs; spf=pass (imf10.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=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719342734; 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=f12gUZaqT5CBj0qbmSntgTFf0542jsJzkP1hUweMEys=; b=6WWej7N93tFgNz4l7V99kUm0kEokEJDBCJgtubVuPTXM8uYYA3XHNceDm2xt24EM1B6jrR qGqC1LUgJB6IRGXeev2d4qcKprqTJ7NMfCb+p/YnME3iLMs+QiGqEZV22KHX+RmsbLxlOv AfrE7iznuKrS4OhVQpbzEkYfzJtQPnk= 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 45PIfU0l003528; Tue, 25 Jun 2024 19:12:14 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=f12gUZaqT5CBj0qbmSntgTFf0542jsJzkP1hUweMEys=; b= DqO1J6IhMcP/dtTaWo6D91ODUm4doxqGMDGJV0ufxb89ftvspfkTWCNR7b0TWrZI fG4qlNre25FDYRfA76/4eNY2/w62r3aWJxUpj4uVMGliISheJq0IPBxbVWYx23wr WQNKyXJFzJHO4i1ReJuyG95NTfo6s6nWtPTFANt9Vz1fSdSmpRbofUb8EhLlino8 gwkT7WVN+na2migUeFOg5I0rcS+bPPU5k78+FIbd7w4XYUwX9RDhsAS4xGQBTU+d vrpAoAVKGQVosEiA6IQhlQ0uyj24NnEguKMGZpRpKpiySIv7+weIgNLtBl2ZUied 72T5H1mC/F4eS3Lz6YigAA== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ywp7shjvf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2024 19:12:14 +0000 (GMT) Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45PHoVnn017823; Tue, 25 Jun 2024 19:12:13 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2172.outbound.protection.outlook.com [104.47.58.172]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ywn27ytxx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2024 19:12:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C42bZ4hMJy/AX/SBS2652Lvbnm/rJFaWTEnZGh5uY6bKFoVV5gsTIm3z1IkCvdsuMS54Jf2rh6rvOAY2BjHJjrRyYlT4lSbudOaT+zDymX/kZIOC9tNVetJ28dteb/NwBFl6Ka6uZp09d61ORfmELtD0i0k3eBanpXq5V9WuNF7aFfAfG/2RKntGcJqV0huBHesvLDitN6asC2rlfotP51o6PWy/CevF+vJ5leVf4yDdMnHX2XcAeL3gU7Q2vJF6uEUyNPqI9z/J+HfF0fl+qDsMCRZ/nd2IZ0tsjkHfgPf7JGDWLpjbA5LdoCsKaJw7+p20yjuAQT89GJcJNAVkMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=f12gUZaqT5CBj0qbmSntgTFf0542jsJzkP1hUweMEys=; b=itU09f4py/NyPLlE3MlcZdaqVpUZ0/12cqNoujMr4rNpjiDjZ/QyEdKgi3FTGE4eduF6eFupWXtjAJ/vrqlbcnw43PD6lWjv8lEKcccoBxn9OUAYr0ug70fii9ekOy1WRAspw5dCDgi6FF8TDCiICfcGBGaV4uMDl+6byrLJgUvaFLCF9CMfZXgsOAdXrqGq43GnXCtVJxWNXXHMUIqcKVv9ZvwVLKBbCddEdam5xtL+gcFJG+/9LEm5dZ+njB281HRuebCrBXbn7xqnI9cLpr9LJrLuUQxaLwaJbNBQRNJ6VLRnX9SQdkq1CMTq3CsW3owmQQYb4Ze0sCWUIzKtcw== 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=f12gUZaqT5CBj0qbmSntgTFf0542jsJzkP1hUweMEys=; b=bRfITZgsv4jAbU+yIcHq5c2Ugr34q/YPeloenaK83xjhgMOIK4Bq8fJZqFN+CMcTGvSv3yxOxu7z36ZWIirHJY5jYtcmNnsqjsT7UPjz8akuFf0bqFh+Liw7+XF/aquQKxtOQ9pWmoalPRSJdXhARBo6LazWmQZQBWamB+y4DCE= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CO1PR10MB4707.namprd10.prod.outlook.com (2603:10b6:303:92::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Tue, 25 Jun 2024 19:12: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%4]) with mapi id 15.20.7698.025; Tue, 25 Jun 2024 19:12:10 +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 , "Liam R. Howlett" Subject: [PATCH v2 09/15] mm/mmap: Expand mmap_region() munmap call Date: Tue, 25 Jun 2024 15:11:39 -0400 Message-ID: <20240625191145.3382793-10-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625191145.3382793-1-Liam.Howlett@oracle.com> References: <20240625191145.3382793-1-Liam.Howlett@oracle.com> X-ClientProxiedBy: YT4PR01CA0320.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:10a::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_|CO1PR10MB4707:EE_ X-MS-Office365-Filtering-Correlation-Id: 82561080-8a7d-44d9-8486-08dc954ab691 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230038|366014|376012|7416012|1800799022; X-Microsoft-Antispam-Message-Info: A/875Jh80dxjQbYKAgvhvUBbPBoZo0v5zddbMQG0iA2UpqArM+SfSi6IFBsCZWhGUP29UO+RsFDW73TlgAQ/Cod36mVuy3GAqXb36oIFtmzu5Ay1EgcFtLSRzBtSk3dRaGUe72oPfKXqjokG1pTuBA95uSCXlmZNQ8lhzsdhFfpvcGiyarLYnoZhAT3y7ntOtgIZ1Sv6Arz9h5Z902uIGM2F/PzN6cSC9GqNH/YQGmfs5XS/AKLxsrdAWVV6QWbmJCEr/8ikPTgJmpdfcAe15szA8T53YTt0TpJe0XeFzLW1O/yaX2NpiyitA3kgiPIRk6Sucx4Yep5H58zuYouXvlE8KWsiUdRRbYcdQ0E3F0wJXh6r/WBu7v9bGxn2r3sMFHHMXVPprrqYLwpn2+89e/feGgYjZS0n9pZ5v+HcbDtRsy/Oi+lDGQ6aFByLkHb3aHMWQ2vfNlP0E6AmOv00PeTNYHNq8Ucd/93q3CGdApWx1o1bWmUEXSevJdft0CDQI5me3PegZY0Y/9L0YxOP+px7eB78nbMr+PGvc2b1rlYklNoRBsZFHezqUPuU6zyww+Vh3ZUZbRFUw5fr8aQCBm69lfWiy23kSQqp5euFSFzzkYbAEd+rFaun5i8b70Ri7Rxi+VLfT8VuLOrpfct8O+dy8ETsU65t9qNcO3hyVwxCcCllzuoOm1n7dGyd6WQfpb0tjeeex5I7BBQ+KpPpIaPDOFbuvhGRP8NobR1CX8kjMFxKx8HMymeGcfwqlr9TbLZQ8/+2G7uxbHxbF7aTQAlNgJEVSxjUVUfKNTkFBahOVwVWYpkkO2JXOR0QB3drYHOmFjdm4ch9pGs5jLQD46SkcWudjOnC23QP4GahMwYrCFl39E9XGxmw53Nzjw7N8NWx1z6G1BYPe/FPGO4gpoY+WzgXpTZelzZRrxMaYWx2qsqD2JPJDLajEfhLDVYOVVB3z8gUVTMwW6Znk/z0rixNOx9gGI+GlQ+tmz0/XmhvZHH2UzLlMS4m6nNwcZDecbjgfDTto/2G+ybSOLYBIt+Nvra0MemahXTj9Ov8kFQy0KTr142plCT5fF1ZVHuGzpSAvVAIgkZLuLGIQDPOdg6fdKlo4KAfTB/WtMJkkTTtPczAzUQhNYM5hNUJqdsSd1nx2ehiwdeaB1wDRFWnPyaKdb+ZDpqZBwia/aV5MVsWv21nwSWYULBjQQm+tUbC/OUO8vZw6LSUGX/m90hBih5yR2DZ1aMTIHo+CyZcgbS9e/h44j83PPuThXM1MiI7yV/N+DgDulWhtjYkarcqzg1huSqKOjyI1UuHVENHzm9QBJj5MOoHJc6kbYkbdQQ+ 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:(13230038)(366014)(376012)(7416012)(1800799022);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ejsJDs8VZW3cr91CklcKkBKXvr44Klb2Bmeeme6uFIl4rYwWNN7iZBwxyMC2xFYaqmYB5apDScVNb8F26S4WClLgWcwW1a2l9hAev7J7BRTJlvlARSrzt8qaEGjDP6yZFdKtUpcAJLB4Twlx7dIhtzIS13t+7lhG+IH+P14wf5fr6cbXbM14Sy161aVD0H7FvZLtLbCpGaz2QhVJ5ZXBU7RIA6CZbVXwvOSF9tkusFgbyLyIQaCLKXPx0A6D5jiq8/b27SHqfXEN2ZUtk2jCw0iGOmZ5eMIeQysKsac/2mlHs7LTDzU3nY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UQK9q9PAMAbuNfoBtlewwy5eubAniSjiAENNhQkMBkU0JR5UAFW0mfOqjPlxgXnvuWJIb97X3SzUObfdYWRQT7n6PfZY2LdbULNusDVqpWqOk1zzCM8uDKxdV/XE76vb0Mfi+o/x2qmbeVGs5/JqPzC3C7+uc6Me4SbYGUkN0F++TlqVslCVU2SI1kjlxMpEE5v+NLuX9pbfex3Jr7d/a874oZc+u4aqNhxIw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: oZhGgN1ZAtTLvmBiVOx36e9GwXZwc7CpMZJSZdxkFfGMZgpkJrYt89m2CJ4Zkd9xvLbYYA6OyOgVVxBPFtp3QGR6mGP8i/wwM1pseRI09aorFXHeGSqWqIzKuxf6Pm0xk4LVVv7nfsu8VVGLobTSNm5aRSOTnCA9+7wjA4qCZJ29n4Ba2uCmZONEZBHuNGwZzWaiie5ussJf//7HuIEzFK/Y0pDp7xyDRv+8wfOIKBprjssZrZ9+KmG67JQIJLjpJ2gUPVbx6slQyxhxuMSXYx4zGMsUoRLTmq1Hl21CiZm2eyzLMUU+1TYZ0a+NIMVcgtck7huvuCqGE4Nx9038MwdRMZdVER6O6jW2XN4wAt3hHNTL4vCJTtpSjAUUMIUzbeOHAO7tXAmIjs8Db3pjc0qFhmr7J6t/Hmp0RO/LSkNp1HEEgyir+EE1v4PuuKlBiu0pLe8SpTDjKlMIvItRouZiE6/0VgFN3BQtYYZ7MmtOSYsZLTTHXa/UMPvpdVNB4c1zB3z0wHGSsU5p6e4pKFWjs98RVWKY9Jfu2Yw6XxwHk5wOcPAJaA1KNCfEfqkVri0LsYfJtT/JMCEdq6WE6Ihoo0J61shvyHR8vkoziJA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82561080-8a7d-44d9-8486-08dc954ab691 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7933.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2024 19:12:10.3827 (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: +9Uo2JVJ2NXcS6Ou3eXPLCvKwMWDS5jgQkXI3ciVmk/8sBA+6JZpnMNVhdoTzrrtAw6NYZMadk6pQ7j7+ojuKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4707 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-06-25_14,2024-06-25_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 adultscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2406250141 X-Proofpoint-GUID: drSW4CsO7QR6fk1_fLdATppIVTpTC23L X-Proofpoint-ORIG-GUID: drSW4CsO7QR6fk1_fLdATppIVTpTC23L X-Stat-Signature: tepsp4z8c39skc3wqbq8gmjxmybjfiwx X-Rspamd-Queue-Id: A1BF4C0008 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1719342742-867754 X-HE-Meta: U2FsdGVkX18OU1IpEo2AOWQnGsLelWKHsYmEJh5vBu1io7sx1rm/b44eXZsEX45DMJEs2GCuk3i19WEqCm5NeymcTQW6uhouC27If35Xz8awdhkvTdILR0FLxFA+ytDTX6bSiT1BlS/kMCmJQzeR1UI+xu4Ebb9lxgVZC2AJ6SuDVkJZCzZ+iBC11shoVZm020r/Wauj8c5x/R7/FGrAp7+sBLPOw9n3XCeCThRNjTU2hg2ietbzXEczm/bU2D+CL3WRYRkrn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KUqXHWSTwkI7Y3amdXp/HKb3Gak+TW/bODGxaoMFDHaCXkmB5RFtU0hdwaVVtsOqrqZEkmGqU47+9nE2fGImSqWOA== 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" Open code the do_vmi_align_munmap() call so that it can be broken up later in the series. Signed-off-by: Liam R. Howlett --- mm/mmap.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index e9858ca8bbd4..f5b33de4e717 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2915,6 +2915,9 @@ unsigned long mmap_region(struct file *file, unsigned long addr, struct vm_area_struct *next, *prev, *merge; pgoff_t pglen = len >> PAGE_SHIFT; unsigned long charged = 0; + struct vma_munmap_struct vms; + struct ma_state mas_detach; + struct maple_tree mt_detach; unsigned long end = addr + len; unsigned long merge_start = addr, merge_end = end; bool writable_file_mapping = false; @@ -2947,9 +2950,24 @@ unsigned long mmap_region(struct file *file, unsigned long addr, /* Find the first overlapping VMA */ vma = vma_find(&vmi, end); if (vma) { - if (do_vmi_align_munmap(&vmi, vma, mm, addr, end, uf, false)) + 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); + if (vms_gather_munmap_vmas(&vms, &mas_detach)) + return -ENOMEM; + + if (vma_iter_clear_gfp(&vmi, addr, end, GFP_KERNEL)) return -ENOMEM; + + vms_complete_munmap_vmas(&vms, &mas_detach); + next = vms.next; + prev = vms.prev; + vma_prev(&vmi); vma = NULL; + } else { + next = vma_next(&vmi); + prev = vma_prev(&vmi); } /* @@ -2962,8 +2980,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr, vm_flags |= VM_ACCOUNT; } - next = vma_next(&vmi); - prev = vma_prev(&vmi); if (vm_flags & VM_SPECIAL) { if (prev) vma_iter_next_range(&vmi);