From patchwork Thu Aug 22 19:25:34 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: 13774114 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 A9C70C52D7C for ; Thu, 22 Aug 2024 19:26:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B1326B011E; Thu, 22 Aug 2024 15:26:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 330628004F; Thu, 22 Aug 2024 15:26:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BF4A6B0138; Thu, 22 Aug 2024 15:26:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DA3EF6B011E for ; Thu, 22 Aug 2024 15:26:47 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8529A419E9 for ; Thu, 22 Aug 2024 19:26:47 +0000 (UTC) X-FDA: 82480863654.19.2F4D49A Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 317E118001F for ; Thu, 22 Aug 2024 19:26:44 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=cJ5TO2Fv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rP0qG9Zt; spf=pass (imf24.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=1724354763; a=rsa-sha256; cv=pass; b=yivHaEum2B0ZL+bTzQi12IrB6u1SlGAwNHOw70dZDOtA6YQUM2alAtpeM9cpKxDztjrdsA qfkzy1LstWNe1PEfzLDTBI3x7EeQKJeIb9iTvNCJV2h5bjtSkREOff3Ixai5XREL7AoOho Ewm8sDP/e3pC1CwRaoOQ4WDpUYn9g/U= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=cJ5TO2Fv; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=rP0qG9Zt; spf=pass (imf24.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=1724354763; 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=cmaw/1Mrrp9JLuXw7iqgGPqWl0hYk2ZF3JfbQyhb8XI=; b=WJQ2lAz8KDgha+732sDXJ9EPbLQkNuIpwDkNZZxsGzQohIfM8MbuNZ1jpYdwgQ7md3Cheo 1sjYWB5XvLzLsjGCp+XBotPXjouzBq+mQnL3PCUEpO5KftGqVNL2dgJ9whi5wDpL+32BBF pSXj9/2yPeDnqmdoz859F6CdkmPChTw= 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 47MIMWwK019187; Thu, 22 Aug 2024 19:26:37 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=cmaw/1Mrrp9JLuXw7iqgGPqWl0hYk2ZF3JfbQyhb8XI=; b= cJ5TO2Fv1xutqCEkrZaC+cCFyxPBh4FuCsuCDLge7LCcUqa/KavUJUSLohN9C+d4 muNB9xs+Qj9TOH/tbrqLTy7HdEUcnPyynnHzFSFvgz7aVFM/R3wixulj1497CNMw X8yNbcdeuNHE+Fm3mClEk309/2s7E1LIw4nX3AM70uH9584pieu7q9pIhRi9+6u+ w92MllYRWyAJ95oWIl7WjCKE7yckrb/IUZiOSOPUl+IWVsrPzLXUQGqMqPRu7C7q MwZU1ecyp/SUJF4tX0C7w3axXUdVwjCbXnEM8ermM6s1d/sZTY07Q23U9z7cE9rp G3nlgFgza2P+BvFDPMae6A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 412m45jwa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:37 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 47MIqaQ0019453; Thu, 22 Aug 2024 19:26:36 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 416b0b9ckf-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Aug 2024 19:26:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N51eNV7Ul/gPm7P1GyfKFYsZSVlhooWiF/EpZDn7S4IMPOkNJtmQuJKBeOqNJqh0iWKH5DcTkUr5FU1UWLRyrw0WKdqTUN/wFt7FCKLpEiNz3JPSTCSEQEvEix3q1rnWkYGHKHDqQbZWMOtZarRhyoqrI2KAjaqLQ1ZQrjsXcPv6rrhy2qC4/eJaXeNjh8XFaifn8yhfDh4pjxKIKDDoSmaHdSVB+j8N4mcWkOFJs63DoO/5O5IR9SFU15R1MehTyDhNHpXyAt/wO4r2cQlVGMrzvA9pmTi3J23E4t/VfRZJvIsIqthQTfKdI8nw0OBWtaFnxq2aNYf7QnB/REJyDQ== 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=cmaw/1Mrrp9JLuXw7iqgGPqWl0hYk2ZF3JfbQyhb8XI=; b=PqyeddQBmqK+BT+71osGUBh1pG7L4uTMugRGil7lGMFcF+v7bK/6ECzRhWO+7y+YYwn5wZMnXHLdcxrowwgjOIit+ltf4aWBQ11rL9pfilICOJ4Rpjqf8mz6c3LmGZ6TwGiICuGI7pyS93bydmf4dLjB2pOvxwJy5Bee9DFNnmX8gK1Uc1LruWOs+bXJ/xzC9kaORKUn9P7xCb0+IJFSJVBRYaGieUzo9Qnfwz99iGEu/Iw68GZbKl4l8qvclmfUwUYm25qSVUgUFGkX3s8kbnPayzVp/r0nWdGYPHIsmZldFNeGw7s65ZaDo8bJ8fiGJ94crBskFD4XRpvQKar60w== 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=cmaw/1Mrrp9JLuXw7iqgGPqWl0hYk2ZF3JfbQyhb8XI=; b=rP0qG9ZtaH6dffR9INs0owwEoL6gQje+f5VkJq+AnmASF6HCVKnVTD116yfBLa3TYmDJqGTF18kRpgxXCY/z6S555lxZq3YlnHHF6YDy9oqyp3bgyXoCZW6VZoTnV9CjXeYPC9VnOPOStkjPwGaO7qO2dlFug9aPJZhbx55CZKk= Received: from DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) by CH3PR10MB7761.namprd10.prod.outlook.com (2603:10b6:610:1bc::10) 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:33 +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:33 +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" Subject: [PATCH v7 12/21] mm/vma: Track start and end for munmap in vma_munmap_struct Date: Thu, 22 Aug 2024 15:25:34 -0400 Message-ID: <20240822192543.3359552-13-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: YT4PR01CA0076.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ff::20) To DS0PR10MB7933.namprd10.prod.outlook.com (2603:10b6:8:1b8::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7933:EE_|CH3PR10MB7761:EE_ X-MS-Office365-Filtering-Correlation-Id: 7fce7fb4-eb17-4ee1-1eb1-08dcc2e05495 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: Zl5m9uWswjpJuSyEA83zUyeoHPqx8LxlXge11OEhw4KMZVxPo6sHYGEbSPg5DJaXVtQM6UsOXS32jH5WpY9HEKfs4d9MyBGfqe0SjIFOQJ+Oe33h75A/8DWebgPo/9pVfeyRoFmPiiszIBi7Nc27pXdwnJk0JWFC2EkbClBafB2KaOoPaA37mZDOlZMxpHVz5q8W+IxbbmKQl17fC4k4Innyy4znaMABdtGbNRw4a6wCVANQq+zHccbPVkttQQ/i7xa+XpvbQBENxgjteWVURnt8Rl8m7C2qBWMZr32ETs9UCz2HrdY3WXZIk8Z3O/6VysPrazBpbqgV1oN6d6wSFlMPgLqG58N7KSeC2dazm1cLH8gnB4wJNHxjCV1CZeglVNqAndKoPbJ86XbbJgNyLTNRG+tCKopnpJ4L6HggEAcvZRH/RM6GA7Vqi3+04ThCnXep+eR4voa4X4z79rTd6gH0bIq38lUsQMcJXOLkEof0vDXY75705TrG6v1ZgSfBKu4JLCnmgoHHwFMB/Xzqd7htwwm3xo/5rRh04WDJuW/W65+hpfsXyRtIH4j+UqcehOBzf8mEifE+pZk5U/Z+XiQ2c20LZyy9GsBWO8BIDc1ge2wnGBJHQASKYph4XY2wNTlXsSpKQ95L7rkStt4u3A+fsvUNollK9qa6HVU08wLdiakhznZ9dGs3SKersolvG680uoIiUY7ariE7j///zugy/0IzA1QvJoaZl+24AIC9Ld2Q/u3Pg4aatWx1UTop4+6v1aDFqZU/9lYYd0AvbdN1/I5VANJCPGddif+b4b9QYkIjsgBHBcZRV6rGyKcX5HRrz4X3BvrFfWYmv72AKeKvO6ncj0VV3tN8E5ozVIV32gN2luZVguLITlVhxdfBHMJtqm1PPu6/QEIG/PORjULDSipNeVFxUUmxzzQQTZ+3tqw4hd5SVq8P4c+PLoOeBLWb3r69j7cWZzNTost2E2ZVgNxIw2M8ZMhp3T2yNE2Sot3eNe77/YsNVMiLxQ6TFlq2jgzIpqOLQQPX6N8GKfYJFiue4A7DMUd/HQSio0mEUJ4Y160uI6aLmk4REUuyxGINIXd3SS5QAYn9O+kWa6g+DaOKbd+qqiSV1PqVXI5cUWzAQlx6WnWXcUaw9WljYWLHfAkEFfDP/tEaQcFxP5/7lyFk8Ue6SHK+rN6PNPiqk7EamBwyZ4NUBe9XNWu1D4Qx4uu98ogwYUP1y+EFZmlKwlyFeZ+jhn+7ZMQJF6JB9b8CMou/1nNUXYRQTSofYs3DIhpQWcByFhUipurmprPGpnqCug6LhB55xLJzZeIPSC7HEeeRnAcjc+AQ1aECBJBqvXX9cCzVmEvPbJ6lQQ== 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)(7416014)(376014)(366016)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 70SiWU+v6TRYfytFuX5ktenH9a4W6O2MQT4F07VviKASyXiH1j9icQyA6u2XvRzy8sAFfxoazAWvmZjIX6St7DIMJn5CJvF6unGbMS0Rtkp4J2wrnXQkJgBnvzKNO+poaXoApKH0YYa4ieUMVht/Hj5wlY7v0nxQp0IrVfFhsd4GcbaYTSPmzZM696huqcW3Uvrk2vB5qxCu1Y6/GLkeQozUEDgR3MK32k2fAKvoZOtWfQSd/A7l+AVXf8uTaFW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AyObiZY4c9XbD8xpU51L//ctELwTxRb5iroeNvcIJOnYaQu9VWzYQRZSfznW2kWlJillgE+ofCwkxM5geXPv2jFkSPIM8RQNBHr3PphdVIjGSHT0lJGYvULhjz0urouVMKKHuDcjkt8bu6z2zTAp6+1Zo/ZdocHPxdzDp1AE+P7Jh+QXiKJO9t4g7Bgd+WbdoZiPNbvRkk5q+ZkmOoJebH4ocEu/2iWm/J9KDReoTud3sViOs8paS2fo3nr3szk4owAaIo89Q+MVxByNdSnYhIES95NZCIw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 2j8d/EA0tN9TUx2ag+qe02ed18qXqaY6x7o+LcNQmELh+lgkxXaOVy0cFAzrxGDOtrIR/vgHF3YOcyUjejcOwhiL55GpmUvcTk/Z/Wn+vxHfmIwBHQI71XtKW85hhtnAwPPxYKlVwl1f6X/gjqnfE1fpIniM8LQzfaAKVc4/rjJr/db+EApJxDR5qPdkH/AiVjXfynf9TRw3g6JGgf0zaHX8bCxnDHQSmX/IHuXCoJRx1rKWzbU4CgDfAfE7Jl0XorgIByQj1lZplwrkh3Muh3Yh3Xduz6098fqF6Gv0aef3FlZhNRWAcoyPqWK220ufeCp6FX/Nzf0TG3j+54UHLQ4gPgS1Ms4PcT7bf02Hd14eNXUMSffDZ5452QTqMGAvUI6TFV0VDhTvHvak1cMfjHzoY6uU4OKFmkyBWBcuBxXORcaJAidcYZ5/qzRkl0a00KarIunqXCvnpAmjNoKtS7MQYrb7FjRC3s3+E4Tz7lLPqFiMNrxser1BDUqjB5f7DmgtJViDPVvrtDwf2BJYcI/BC16Yux0DpF5G/V/Oa1b3Tlm3LyL06kZYgf02mMe/lIjn6YtZa+KEPv+1lK151qK5EuEjrJZATyHNvocWWnI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7fce7fb4-eb17-4ee1-1eb1-08dcc2e05495 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:32.8850 (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: YaaJk9UdI+AEI3Z8IIZb83/1mqkens7BESWXG2b2W6MsoakzLOYQDJ1XVB1nBrEnGDHIJjYGI6x8orJ9q4dtHA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7761 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 malwarescore=0 suspectscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2407110000 definitions=main-2408220146 X-Proofpoint-ORIG-GUID: i_8CGIDrfEBl9JSAre4-N8OErO2kVPbw X-Proofpoint-GUID: i_8CGIDrfEBl9JSAre4-N8OErO2kVPbw X-Stat-Signature: tdc54k7xhh4i44g9xaximny8zwtgwnz3 X-Rspamd-Queue-Id: 317E118001F X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1724354804-191030 X-HE-Meta: U2FsdGVkX19H44Y7UnnMRezjAc7GuvD9qILdENzVQfKlsZtoAxtji7yrnP0vaLnThIVqiwoocrRa6AMv4sPSrYuOZMRQ9P8YAxHU06/6ixjHmRvVDryISh8sqZH2v3MhhmU6Gv40w46T+utRf69QO7HnMQt80a63H5zNT2IUCJ3ba1UNb2nIox4bVMtPV3EFNNVGd8rF/cXXus8vvzoxdBBwXmdRAZQOU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1prCjLxgnAsu3dAAv3g+/SbdYYPepb6tI40wOKeeyP9tv33onUiQklcTVh+LrtoIrMwNkPTVPXOD+uivmtwHXencr2DZoox0lSJJBwJT6ygx+Pc0Aa5qbYRX8CTpqPnzv1LyBvVyqx8XOeQ7fhV6XiAIwF8mu2L935+LV1V78KTO+RoUBevRgEwOFj+YY3lTlUvPhVZOpMv/tfEOz4N7ZDBDFgC1b02GebA== 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. Add a new helper vms_complete_pte_clear(), which is needed later and will avoid growing the argument list to unmap_region() beyond the 9 it already has. Signed-off-by: Liam R. Howlett Reviewed-by: Lorenzo Stoakes --- mm/vma.c | 32 +++++++++++++++++++++++++------- mm/vma.h | 4 ++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/mm/vma.c b/mm/vma.c index 9de41e1bf3b2..dda0dae069e2 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -646,6 +646,26 @@ void vma_complete(struct vma_prepare *vp, uprobe_mmap(vp->insert); } +static void vms_complete_pte_clear(struct vma_munmap_struct *vms, + struct ma_state *mas_detach, bool mm_wr_locked) +{ + struct mmu_gather tlb; + + /* + * We can free page tables without write-locking mmap_lock because VMAs + * were isolated before we downgraded mmap_lock. + */ + mas_set(mas_detach, 1); + lru_add_drain(); + tlb_gather_mmu(&tlb, vms->mm); + update_hiwater_rss(vms->mm); + unmap_vmas(&tlb, mas_detach, vms->vma, vms->start, vms->end, vms->vma_count, mm_wr_locked); + mas_set(mas_detach, 1); + /* start and end may be different if there is no prev or next vma. */ + free_pgtables(&tlb, mas_detach, vms->vma, vms->unmap_start, vms->unmap_end, mm_wr_locked); + tlb_finish_mmu(&tlb); +} + /* * vms_complete_munmap_vmas() - Finish the munmap() operation * @vms: The vma munmap struct @@ -667,13 +687,7 @@ void vms_complete_munmap_vmas(struct vma_munmap_struct *vms, if (vms->unlock) mmap_write_downgrade(mm); - /* - * 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, vms->vma, vms->prev, vms->next, - vms->start, vms->end, vms->vma_count, !vms->unlock); + vms_complete_pte_clear(vms, mas_detach, !vms->unlock); /* Update high watermark before we lower total_vm */ update_hiwater_vm(mm); /* Stat accounting */ @@ -746,6 +760,8 @@ 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 @@ -810,6 +826,8 @@ 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. */ diff --git a/mm/vma.h b/mm/vma.h index c85fc7c888a8..7bc0f9e7751b 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -38,6 +38,8 @@ struct vma_munmap_struct { struct list_head *uf; /* Userfaultfd list_head */ unsigned long start; /* Aligned start addr (inclusive) */ unsigned long end; /* Aligned end addr (exclusive) */ + unsigned long unmap_start; /* Unmap PTE start */ + unsigned long unmap_end; /* Unmap PTE 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 */ @@ -108,6 +110,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; } int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,