From patchwork Tue Jun 25 19:11:41 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: 13711866 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 4CCD5C2BBCA for ; Tue, 25 Jun 2024 19:12:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35D5B6B00BB; Tue, 25 Jun 2024 15:12:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30BC86B00BC; Tue, 25 Jun 2024 15:12:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EBD56B00BD; Tue, 25 Jun 2024 15:12:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DE0DF6B00BB for ; Tue, 25 Jun 2024 15:12:27 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 93F5AA054F for ; Tue, 25 Jun 2024 19:12:27 +0000 (UTC) X-FDA: 82270357134.10.4E630C4 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 3608F1A0008 for ; Tue, 25 Jun 2024 19:12:23 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="T2o7R/1B"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mGYBobBc; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@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=1719342727; 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=2C47QT2h4bMPUfGiEQ1EmT7/uBhtsa8B2FgGIJ4qDYI=; b=OLYQMOXgxkCxI1W4tvUF22Ge1eni7Y2b9FSKcLJcAtQZ5geAzcXZHvPniXOBKxUL4FxCqu TNG0LxSvaFc0XvTRxAYQLTt3j/fIbaBdF8jvuSn5vojgqEovPcxY5yNtHFXGkUCt7+5zC4 uao7aguVOVJWPLFzuJLZaJdEZ8uqPk0= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1719342727; a=rsa-sha256; cv=pass; b=cpe8/njq9Jk1X4hJOcIst6OfQYF9tVrkJzF2GyYkZyCV4MqEJi76TUM967BW6kgvmQn1QF 74YUvxGNvP4D3ZKSyIKfpeHf9JHC5yS7cVhTij/xjrgWjbOcSDWCMit0BzfpcL+l4GY93O Z4hycTWcYEOT003EydPsReaQgCeigi4= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="T2o7R/1B"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mGYBobBc; dmarc=pass (policy=reject) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of liam.howlett@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=liam.howlett@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45PIfY7q009067; Tue, 25 Jun 2024 19:12:18 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=2C47QT2h4bMPUfGiEQ1EmT7/uBhtsa8B2FgGIJ4qDYI=; b= T2o7R/1BxtVtVS1qwJShcVe7ZB/vUf8fxDcy1xApRJqshafHuJSMZUYwxlyV2Wjm L+7gK9dYb9FRXN1t6EXB4tnlBmtyEXM3H3pH0ssPoMf3bGK1PuQvwHJJFmJUh2wa vlBSpqZ4445ASVzxIjpvTETyNP+RLbivcjkLKGhDNWI1oJdh3U8risZXDgfVvjxc di6iuMlldLtyDmOSEz+wl+hxjOiM5TnIq2eBSQkdDq36zq/Pu5aaybHSIOnARjZm HmW3mH83/uaTD7YsvQqfAIbgCyoKEjZpBSs3OJ6XVjNSZzqARNndM8kTofiBofmV p9ZvSrAfhoLIpt9tVcjfzg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ywnhb1jqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2024 19:12:17 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 45PIvN1s011492; Tue, 25 Jun 2024 19:12:16 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ywn2egtsh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jun 2024 19:12:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nQm2af/Oxk8M4+P8zw2Cxv83bHOq++aKpEQap02LA795N2qz5+s/UalqCDudYfLXIks5ma9hSB0tQRn2uxiJS5h5mOW0/lD/LT5fos+R7jkQ/l5Yxn8VZaRspMGmV3F0bgJH6PK81RcScDvmlGQgxacmqUaX7k/AuF3saEqtT+OQ33X1s+LfZFBPt4IkMQBe2qjDssgtV41fl/etnC8/pRzC3Af30Sv6sB1DrcMA8vfwFymCf8ikRapq6dxzqo3QeLfKrJX0ROSzACCDpmDPZh1cw/aK7py5waFUeN4mIsGBWrz+f0HWAgseHIWzHQIx503OZLE2ThuON/+VsUQ92g== 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=2C47QT2h4bMPUfGiEQ1EmT7/uBhtsa8B2FgGIJ4qDYI=; b=G1trylSndNv2kCKmp361dnXM9pAlQ3ZwBPqLI1vmlNvSilVdTGykqadhTbIca2/pp//miBTCBW7Lpa7ZqqicOjPGfoiTMnNWohqVG4pWnMKX9XifBezbqRWwtHu7+6TNiZPT1kX0/JrMuWIE9Y14C8rZKJd7qh4ytljKikbKK/i3eySriVIJ0k1vLYKIQi2uE7j/Dt16/g/Vn7gVCzDGm7mH2q6BY8DEoVppawT+l30dbfGKwDYqKu/Q8QXo68g4HbuWJsPW39UefVZz0rnQjl887S2GaVpEpZIj1sx83+iaxyqJUAnOudh2qrj7YetK8bsFAeAkvaFMeWn88h1rNA== 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=2C47QT2h4bMPUfGiEQ1EmT7/uBhtsa8B2FgGIJ4qDYI=; b=mGYBobBcMRUIk2viXHomlfi2J0hHrAozHEfT6dJOUFBF1T0Nia+YzXI7zjzoq4OU8erAw/Siw66mM/4wKVAVSc7PunOwET9zjwXLcMFzmXeB9cXil9e4/+CvL2YMVyRCj7M0D2Hg1kpQaV6nqIUfy2vEMbLVRmYzL4/iwNJHKzY= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by DS0PR10MB7066.namprd10.prod.outlook.com (2603:10b6:8:140::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Tue, 25 Jun 2024 19:12:14 +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:14 +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 11/15] mm/mmap: Track start and end of munmap in vma_munmap_struct Date: Tue, 25 Jun 2024 15:11:41 -0400 Message-ID: <20240625191145.3382793-12-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: YT4PR01CA0200.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ad::29) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|DS0PR10MB7066:EE_ X-MS-Office365-Filtering-Correlation-Id: 759bba6a-442a-4ea6-fc50-08dc954ab901 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: 9EcHe8MMTkNSZakHbsxcu+Z5T9D8Niv68ojbfe9B9wibT7cisT/B3akxbWelTCGxYt3ZkTL3byKxpPcA0rW8VWAyiE7+YBfICpnMCToOMYt1dKgKEF6cOWWlQ80pYvKAUHBS/W25mSw6GI7a7RglG3RQTXBYHxuWL2I923Wkyr3LZ1mmE/D9P2Dg1P1DPDoxjawlVJFoRhMAHpATEoFhrTeNlidU+w67m0IHY6kahp63ncp4BcpkBuo0b5MY19ZC3vTxT7uZQbM3ZIAa2NYKxjlkuUHgc8rEiHhIVanHYqHVVCpeVr2FVt0xmIDy4zB8PB3lua6RFZFM+iwQYuKT86T/qijXOWRl5QLUdHPu9XhckhgbudQWj/x1Xpu1Wt/M2wggfOkOdm8nTkQUG2aBg3MwnTl3+acniI/JIPS2/LQ9gtRQPcbHbH1M7TYndsrvpzUjjNHmmK3hbpqCc/LfETaVXITA4CdOPC6f0jbooCVpDqsQPCYyt/w/eRiO4sXt3oCpAPrSU1jLZxWGKk30XSYrzfcvEP3GI6bfj+qRO1WIqfRiQKNI2QyA3c6ngiCtoSY5kczrsxYNXRhLBrD1D6RCa09uQ+HLDqsfH7HpTJDTw/8wJTgEdOOwlDUtwkqowTDiiQwy9dyKDlNzul22cAXH06bCm1MDyWqbbZ2yKQ0NkJlspqBpyC2dOp5T/NI5CY3Ci1M0nC9EmguhmQvOJLJYSau+UCi+6jnQphv2Gs7NML1VfZUbRcUJrgswC0RqzDlhMW6AH3ws55Bh4u9omCQvjFd8Q7Z3FI3+/wPbM+vkvsou2iAS/o+qnBy4vF1VtEBFa8VRW7/BdHfOBzOdGa60l2aRFZQDWP0jpiist0SJq8jwC8MGcv/Q21c35Q3xrIZcWbBSHjSmqZPtGLslpSbma0zgjIPATXvOGcW5uMs5lrWocUMLYo9joSGAFyvSX9J4twNY/2/3C6XW3wqrXFMdbvwKQcNSaVNWduGugowYI1E1yRWIAUivmPTPU9ebrmLzes8Fa3euqkofvdDwEXVVC60Z6gf7Ak9uGVPci3Uwto1J4nDWsZVtfE0PmbxKyYG90cVqoOpajSlLwbEyniytvzQxSMMhuWuyT8iEFTg+R7c+0+DyBK67r56A1E6be2PpXyvmYhZ4PBa/usu5ZsrNgHwle58YfDhE2oyJJZzucgLudYCSLcE8QORzH2TzTDnwfKibiuQ5h5i36t6770mxNIMUlJKzTn11L3j1BWv9mstlnb5A5rbdUGfmIzoJi1lBFFSpeBzM/QsgMceHgXzMBX1n6siSnJu4fMVVBiYRtEhP29wfra4xCk7i7Oyo5dny748MtYWNTjLDPq1SzA== 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: yeYjv6UhBoHNMHCFp9L5I2dKDkYGW5F8q8NpO4XD6Hr/k9XXFBGjHDV/ouB2PqV3WCGzp5JuuuvMr2xcrJnO8mqTZCvLRHpEynQQLvQw30PphEGGXw3lmPcp3CJj44Km76/+vTfiBQFZXWQgWp1A1XUzQI7Mt6WW4k9DrS0eJ9UwSLKGyksd8NYVhuDWFUtyaoJ2yUn+3tSnAWBC2Bv/lVxB1xEJWWRXhVaFWj2heCR+V0EDi78z1XHZJoEK7MAn2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DvOgya9RmUVIaQGwfykpBCW+NxWdDFTthn3gOvYCNwcw1PWCh+u5dwB1595dpXiIkxu4xfVsFp61IearespTSbiE20NbyxebCRHo81uz8FBoKRD543QZjBt3eCY3Jm04MBCZyPgiZXzfMoJxGHKzoc/JONWjF45qd3kCDYHcragCrCYTQg9XIGg5IcD4YqWABGqVWnVot7UN8+J0fmcWl4XYHPbEwhfreJNrZCxgkMxoQQODtNCyYz+K/bcOaohqVtJYRBf3pZUEBhAtRU6SbuFgq+gQORu7HVQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: iR87Gtnr6J8DbyiTfTn5CChZSq692p1Joss7uevJmoQUcYXuYu+OgtYzDQLgHftIG1ncz7maD1cVL3HXKaDjZKleCEceHoxgXg9jB3KKmmOO5vtRFhvIc7nuxXLLpi38HGD/ZaVsDFScE0LM/EsrEtf861/cXA9CTltjWBS9IRqd7UnJjuiaLnGWtICJS91fGDe1d9fr/zN23pvBEAquycRtrfNPIQi4PuE3gZsWbIoFyuLqwk8jwPHxn6LaV2u0fYjfEno7rfmF/O1pn9x1AoD6ZKYZxbzHmcxLFZ8/EVIj2/janG46/sUxwphX9hePKgSowwR3A9WtAke1ZWYLiUACoujPUlJPvNOyIBPu/n22piI/q8VnrNCyYJ+FCtpHIjjqVmwNodzTCrRlCpXZxUadjD3i2QWvsxmJOUQKfGdQlaHI7GfJ1RWMRgSr5/TQaHD3qSScb3mpRjxrZWT4LhhaYAV+knqAlbGl4YyFjZG+JadciZgI/J+M/q/oyu4fKS9NbLx6t+CZtaj3LT4xwL73wK8bgpUP63GWMt9y5CGCofsa8l/Infg+IeMi5BeqRYtbI5VF5KXW2fzb7O+LbXzB0sI36XaapE0hxXbELaI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 759bba6a-442a-4ea6-fc50-08dc954ab901 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:14.4733 (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: LlYM+ZHEVeUfW8yNKNJEn49BFB39K7q4xMpRwawlk79XVEhDeF5HNkaGIMMDKtB/Ygr9dQNpztsLDqejpWFvoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7066 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 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2406180000 definitions=main-2406250141 X-Proofpoint-GUID: vHLokLqYuztwhig7wlvafLp5p9ScFa0i X-Proofpoint-ORIG-GUID: vHLokLqYuztwhig7wlvafLp5p9ScFa0i X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3608F1A0008 X-Stat-Signature: j5in66cz4eb3cx5bek8i5hs4t7gaif46 X-Rspam-User: X-HE-Tag: 1719342743-308317 X-HE-Meta: U2FsdGVkX18eUvCcxVz4P+3AaF925sRAkVNC9uiBOdCQxvlY4bKWftMCpRxh7V6lMRKViULKog+KyGWerR2+3/dDWmv/o72UHxNjSJ+U7hUuI7l0ChBYdqFUmdserkj+s+mA8zzqq9VzO1KcaT2Iap6ZItEg/stn5px83d/vGTKv+vI8G6J7KvS1J1kKswqnuA27kWjYIMA5VQiVOacgCvkY5uhX5QICMlCPSe0STSehUFpZNX0W+ZRb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p8HM/PjrbhRzFZgeOX9rDud3HWE/ioCiBXLCqHRUs6bcMfGleTp+Qu6LrsQK+5pOLm2HL6MupCsKPYrDME5VuIa4pu8lkyQCoTWcCNP9LavFIluoDcWRBWaJ135/99wPB0NgkVJ8dnk3C5WenUKGusncp9zOfEkBdpboX8VLJR5H6mF 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" Set the start and end address for munmap when the prev and next are gathered. This is needed to avoid incorrect addresses being used during the vms_complete_munmap_vmas() function if the prev/next vma are expanded. Signed-off-by: Liam R. Howlett --- mm/internal.h | 2 ++ mm/mmap.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/mm/internal.h b/mm/internal.h index 90cab15c3b81..b0300cb22353 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1492,6 +1492,8 @@ struct vma_munmap_struct { struct list_head *uf; /* Userfaultfd list_head */ unsigned long start; /* Aligned start addr */ unsigned long end; /* Aligned end addr */ + unsigned long unmap_start; + unsigned long unmap_end; int vma_count; /* Number of vmas that will be removed */ unsigned long nr_pages; /* Number of pages being removed */ unsigned long locked_vm; /* Number of locked pages */ diff --git a/mm/mmap.c b/mm/mmap.c index ecf55d32e804..5efcba084e12 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -525,6 +525,8 @@ static inline void init_vma_munmap(struct vma_munmap_struct *vms, vms->vma_count = 0; vms->nr_pages = vms->locked_vm = vms->nr_accounted = 0; vms->exec_vm = vms->stack_vm = vms->data_vm = 0; + vms->unmap_start = FIRST_USER_ADDRESS; + vms->unmap_end = USER_PGTABLES_CEILING; } /* @@ -2409,9 +2411,7 @@ static void unmap_region(struct mm_struct *mm, struct ma_state *mas, update_hiwater_rss(mm); unmap_vmas(&tlb, mas, vma, start, end, tree_end, mm_wr_locked); mas_set(mas, mt_start); - free_pgtables(&tlb, mas, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS, - next ? next->vm_start : USER_PGTABLES_CEILING, - mm_wr_locked); + free_pgtables(&tlb, mas, vma, start, end, mm_wr_locked); tlb_finish_mmu(&tlb); } @@ -2637,7 +2637,8 @@ static void vms_complete_munmap_vmas(struct vma_munmap_struct *vms, */ mas_set(mas_detach, 1); unmap_region(mm, mas_detach, vms->vma, vms->prev, vms->next, - vms->start, vms->end, vms->vma_count, !vms->unlock); + vms->unmap_start, vms->unmap_end, vms->vma_count, + !vms->unlock); /* Update high watermark before we lower total_vm */ update_hiwater_vm(mm); /* Stat accounting */ @@ -2699,6 +2700,8 @@ static int vms_gather_munmap_vmas(struct vma_munmap_struct *vms, goto start_split_failed; } vms->prev = vma_prev(vms->vmi); + if (vms->prev) + vms->unmap_start = vms->prev->vm_end; /* * Detach a range of VMAs from the mm. Using next as a temp variable as @@ -2757,6 +2760,8 @@ static int vms_gather_munmap_vmas(struct vma_munmap_struct *vms, } vms->next = vma_next(vms->vmi); + if (vms->next) + vms->unmap_end = vms->next->vm_start; #if defined(CONFIG_DEBUG_VM_MAPLE_TREE) /* Make sure no VMAs are about to be lost. */