Message ID | 20221114235507.294320-4-mike.kravetz@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2431541wru; Mon, 14 Nov 2022 16:10:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf6mp2tWJvm8rHZKNS8twEWdr3ZIS/M2Q6Rwt0/hxdMWzGn+6Spsun9cK0+1gxEpgcOWUUxl X-Received: by 2002:aa7:c0d6:0:b0:467:7519:6bff with SMTP id j22-20020aa7c0d6000000b0046775196bffmr11287225edp.301.1668471008954; Mon, 14 Nov 2022 16:10:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668471008; cv=pass; d=google.com; s=arc-20160816; b=0XGhXb3UHG7nNew4HREpLF5PMQOw60Wpgzlwg4SM52bT0Q3K/fsEwLAG/cRJdRoq2s ZPm1pYN7T8BsV1rU6uY65I4AejS7tL6SINsgX3m3e1tGBekqbwkkNcA5ZJEO1gx0Zg1O Iek5dmmpWtcf8jviGuhVlGuth5r5lkJUmGWM8+hMleDsY+YqZvGMv7SSko3g2pm+N5do b1CbAExfDbnNHHxhJsvMScLl49Id0OGQGTwWzt/10+jOC0ip1Jm9ndR6qBFKmmzVE9mG lbdc3oFY/8fc754dtmzjv+0ZtlfQDhybVpjynloNUiWG/NJbkL7HfAIcbP7U9+iCkPlm YMGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=VPPSt08uUzVOjjlup/WgRlm3neDn1ahbKHMnfHdh9ok=; b=H6oFkReWNOfP6pyg4nEYNMg6h2f8IbhEDnZl/pk/9MoRK2B3SXYbCjee3oscdvGIY/ MScNVD+ZiTqPK0AfMbHdj/tyxbFXW6osl2wY+ZT2VBHqw7WFL1RV6eLFGORilA020mTg 45acNY9vhutQI5NdRv2bt5M8mizYrjemF1Ynz89cnLK8kpkI4qFsR1jDEs9e8+EV3tAV 37lQYjUzpfkeGlnYE0w8T328yqHE61yKNEEq4hDecmV9V50b9joBfFVuvKQNN7Kga8RR WzYra9q1f+p8/RRN9WodpmYCX+0PpqkSK1eKC/xFm98QyW8j4jlPztSexWjrPAe+IfHs 72vA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=x7jJ1MTJ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mSyk5067; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a056402514500b004593bcff7e5si8525109edd.475.2022.11.14.16.09.45; Mon, 14 Nov 2022 16:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=x7jJ1MTJ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=mSyk5067; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237423AbiKNX5v (ORCPT <rfc822;zwp10758@gmail.com> + 99 others); Mon, 14 Nov 2022 18:57:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237577AbiKNX5g (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 18:57:36 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3670FCFB for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 15:57:35 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AELDo1l025717; Mon, 14 Nov 2022 23:55:25 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-2022-7-12; bh=VPPSt08uUzVOjjlup/WgRlm3neDn1ahbKHMnfHdh9ok=; b=x7jJ1MTJf2TWbSLZ5LP02EEYLKvL3nv5tXWJLsbwIcVfYTj2cxLi8BDnRG89giAN71ox 0XU5bL+bRQaSqH25G5A9EqGtitKI9xaNVt+ULrTpJ/cE6PRQELa7TihoEztaEsJ1rU42 hhDpXYVOA5ClbwBBD6iTRmIOGER+vz3Yl7xKkmemaIkmkXrMfZwBm/6xERrhIG8b34/k Hn/CPSZ9p0D/hWt3dvZQevHp9u2iBFCsGbxVUxMQ46KFjn8a/jZPJmdYWWM/m6BWxs45 5e5FFaIEf6b3vf7BultyVUVOrYejBTg8v2bM/lygmy9fUtHu02lvw2AyWpLZhsqaD0gf bg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kut2eh2rg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2022 23:55:24 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2AENTSSv031835; Mon, 14 Nov 2022 23:55:24 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2041.outbound.protection.outlook.com [104.47.51.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kt1xaxyb5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Nov 2022 23:55:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5GjcZHp+uYezbxqpHjN5QfGxO48v+TKy4Yl7rvgpmjbVgzN9MU7Q4Z1Z3mUj6YaxmE/MejB5FlGpiODOL4Igt/vB6FOD75Q6DTTvEbnY4ll1VTUYdc2DVCwJAAi7lYBVTd8IFQ4IQO1ICS4Jrp5Yk3L3YQAhGRutmG914vs7hlT3ITMQkcBqGgPguFESk2chhoS7mrpWHl1dQ0u4gqGSgk7/dwuKQJJKliQnOPVmiG9LGsvPXxx+RjCczh5vwJn4YJE6pXvW+y0GBalqEpwNix/pCdaJFlRbldWALGJ5XL/e6ZB8webQeiWo3Vzjkdmm+EbzcbGmM0Ys6ljvVaWQA== 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=VPPSt08uUzVOjjlup/WgRlm3neDn1ahbKHMnfHdh9ok=; b=NPmS63Xpvpq6H1bMdt2mhGcVPV6gQpetbriaE5u1fVZok9RqsmpshPxJF04IwN+MtK9JRccXYFMyz/2M1FMDIuuteNu9r/ZWuTuqcoKgctF20KCnuaWBTtV11uUyQQlLQAq2eOLLhjhq2wKP03wB5IvAUYg+qmMAzCYS1lZJCd5pHM+yz9Oiv229du5VeByn2ZER3GoJNMmkZ9BOSqOo75yzUVs2U5zfRDUaVbpShOAwNQlahglWgHFIe6MwKPK2Iz6n0N1UhwIMyf2FxzJ1wtVYrfSrnAgK+H+ppi1xaB8DWMHGvv3nr7gyhCSSuSffVWXnVg3sJwYScSgRZv7PxA== 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=VPPSt08uUzVOjjlup/WgRlm3neDn1ahbKHMnfHdh9ok=; b=mSyk5067qaSkurjUL2xCDSTKb2tCRyfe8Oo4ltz1o4E81OBZXHKCG3CegnUtp+nbBNon8oWhFom/XZZfwU5nN34Ae36px/YyBHy5XCEYUGr0xe6HgvRU84f6K3GqFM+1ZKEsyfooR68A3nMgo9vThaz8gL82JfR1ZAfNChXjNwI= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by BY5PR10MB4178.namprd10.prod.outlook.com (2603:10b6:a03:210::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.17; Mon, 14 Nov 2022 23:55:22 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::8d67:8c42:d124:3721]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::8d67:8c42:d124:3721%4]) with mapi id 15.20.5813.017; Mon, 14 Nov 2022 23:55:22 +0000 From: Mike Kravetz <mike.kravetz@oracle.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Naoya Horiguchi <naoya.horiguchi@linux.dev>, David Hildenbrand <david@redhat.com>, Axel Rasmussen <axelrasmussen@google.com>, Mina Almasry <almasrymina@google.com>, Peter Xu <peterx@redhat.com>, Nadav Amit <nadav.amit@gmail.com>, Rik van Riel <riel@surriel.com>, Vlastimil Babka <vbabka@suse.cz>, Matthew Wilcox <willy@infradead.org>, Andrew Morton <akpm@linux-foundation.org>, Mike Kravetz <mike.kravetz@oracle.com> Subject: [PATCH v10 3/3] hugetlb: remove duplicate mmu notifications Date: Mon, 14 Nov 2022 15:55:07 -0800 Message-Id: <20221114235507.294320-4-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114235507.294320-1-mike.kravetz@oracle.com> References: <20221114235507.294320-1-mike.kravetz@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0123.namprd03.prod.outlook.com (2603:10b6:303:8c::8) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|BY5PR10MB4178:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cc96700-109a-4945-4ea2-08dac69bb169 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s8wugrLrt62cio3RX1j9476oN906a6Q/20mZCw3Ryj+08XNFD6Lg7bkLCyMuC+Lfq3/kygps3Ii13/rBDhaqrRDyx0rIRyow6elERrcnDAzU65N+S/YFw3bHlxIbS2zG5PTrDUw1dqsPDi3SpOznvI/JY/ivtXaieJa413DFp20dPtVZbLb9WFwKaN7GoUqdcJF2ZUMX+0e0InayaZNjmGvvcTLqbG3J7ssFAoq0DYsSaSL6JJlpIgcTmM2jMkI6kI9+wUg+T3yDMoiiNy5awCjM5/luyxWH0qyLQSMvKKULpTeCChAegMErajK+9LYrfMJ5ntrQWLoEwwdbcx/eqB6YwkS83EDyC8osUGFj5GZNGJb6LAh1VTd7GBIu5PejsbbYVRgJyFtV71bwFwxRNCb5PmrpiYR13UXu2+lKkpz4z+JZH5s6d2CkaXN01hMr0s0tbu+xh+n8o+bZgff0p8yhGHfQ2LEsaSqVJr2e8FNNm7WVysrPbc9CY0WQSyYNUO32oe6LmJqHBWD4mHOsGOSwVs4RgCaoUUxNfAfFhOrrdojXBfm+dP+pD5jPwQojpfCawiiWm9o5fbkbOnQBpIExITlvBU3VFfXVHzRrvn3J7W+EPx6CwPD+L/00kuTMsguKwnVo6PgiIYIzf9Uk6o5T6Vg+eEnqwxOuprfvUodUev5tX22ZNXILHhD+wd7/xH9EhuDJ/q6n8GILTvnJTbassIk5agannPru9f4kcP2ExH7P+nrfgc4hRvPMEbIq X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4196.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(136003)(366004)(376002)(346002)(39860400002)(451199015)(2906002)(4326008)(66556008)(2616005)(6512007)(66476007)(8676002)(66946007)(41300700001)(86362001)(36756003)(1076003)(38100700002)(316002)(6506007)(54906003)(83380400001)(8936002)(7416002)(186003)(5660300002)(478600001)(15650500001)(44832011)(107886003)(26005)(6666004)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wJGXeqnq8xJWvPLkpxYGtKIZ5XPP3ESAFBDwGLJGHndBxy9OZsUks5+lkvc9YK3X29FddfGHjBU/ceqAaTZJ/kD7O8bcRnpaCuGFtld1eULhvS5i5JVa61AFnnqKow/xKuC7KrIwwfAOAsn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J23xqRy5unCI2y/VKeSXpadnhnWeq/oYjfbOcOKN52fLbPmBGJXzMLOUguY+Ru/e5hX95L4H+Hke+suRCxZQ3oQ+gU9QDldJ8/C3lTiTKxuLd4FhSqXc1P79l1vp0lpJiqQTGhgUvy4Y07nhiQlHA2uf9waWaRHIQs6simlUL+2WSrdnGVlAbVYd6G9qtzzbiNfDPKFZHu1ElPO9dlZQ0t8RDS8zpPcAIrRdIOdTgl/F914v+FGkEytw5m39tSr/TbYb8HQ+QaVP0IwXdtvZsDglUx/DtwJq/8eRnP0cfiFHYIiFlpzBBv73Msr+qi7ECCQ2hgx1h0AxqJtTZEwDwL+h2+omYp2lzzJT3wzzY8TLkQUzMd4hVXyHA61mQQExpshVD3bM51DEnC8egt/QmAmNoDaVUwCBpjUvQcVE0ZeBwWm8LeLEnZVu9c0jOqX5GaRwlo1jjuKErrbkKMYR7QbB3TZGh7QU+R/tVqRdV7+YkZ5oduhN2t9Z02kuMOPFCq9e8HCMAe6A2RaLEkxKg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cc96700-109a-4945-4ea2-08dac69bb169 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2022 23:55:22.5983 (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: 555MH+6zYauQcw5wLjtFgZTQNbASmyzhNOwzuzMjlQj9AcsNFv3Ig2mFEmUlrfbDw7H2pyw0B5Fak54IjR21sw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4178 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-14_15,2022-11-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211140168 X-Proofpoint-ORIG-GUID: 3eslPMFgPWOTHRGhIK3cSlPdlYMG2Luo X-Proofpoint-GUID: 3eslPMFgPWOTHRGhIK3cSlPdlYMG2Luo X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749518657008351323?= X-GMAIL-MSGID: =?utf-8?q?1749518657008351323?= |
Series |
fix hugetlb MADV_DONTNEED vma_lock handling
|
|
Commit Message
Mike Kravetz
Nov. 14, 2022, 11:55 p.m. UTC
The common hugetlb unmap routine __unmap_hugepage_range performs mmu
notification calls. However, in the case where __unmap_hugepage_range
is called via __unmap_hugepage_range_final, mmu notification calls are
performed earlier in other calling routines.
Remove mmu notification calls from __unmap_hugepage_range. Add
notification calls to the only other caller: unmap_hugepage_range.
unmap_hugepage_range is called for truncation and hole punch, so
change notification type from UNMAP to CLEAR as this is more appropriate.
Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
---
mm/hugetlb.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 7559b9dfe782..0cdefa63f474 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5074,7 +5074,6 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct struct page *page; struct hstate *h = hstate_vma(vma); unsigned long sz = huge_page_size(h); - struct mmu_notifier_range range; unsigned long last_addr_mask; bool force_flush = false; @@ -5089,13 +5088,6 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct tlb_change_page_size(tlb, sz); tlb_start_vma(tlb, vma); - /* - * If sharing possible, alert mmu notifiers of worst case. - */ - mmu_notifier_range_init(&range, MMU_NOTIFY_UNMAP, 0, vma, mm, start, - end); - adjust_range_if_pmd_sharing_possible(vma, &range.start, &range.end); - mmu_notifier_invalidate_range_start(&range); last_addr_mask = hugetlb_mask_last_page(h); address = start; for (; address < end; address += sz) { @@ -5180,7 +5172,6 @@ static void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct if (ref_page) break; } - mmu_notifier_invalidate_range_end(&range); tlb_end_vma(tlb, vma); /* @@ -5208,6 +5199,7 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb, hugetlb_vma_lock_write(vma); i_mmap_lock_write(vma->vm_file->f_mapping); + /* mmu notification performed in caller */ __unmap_hugepage_range(tlb, vma, start, end, ref_page, zap_flags); if (zap_flags & ZAP_FLAG_UNMAP) { /* final unmap */ @@ -5232,10 +5224,18 @@ void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end, struct page *ref_page, zap_flags_t zap_flags) { + struct mmu_notifier_range range; struct mmu_gather tlb; + mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, vma, vma->vm_mm, + start, end); + adjust_range_if_pmd_sharing_possible(vma, &range.start, &range.end); + mmu_notifier_invalidate_range_start(&range); tlb_gather_mmu(&tlb, vma->vm_mm); + __unmap_hugepage_range(&tlb, vma, start, end, ref_page, zap_flags); + + mmu_notifier_invalidate_range_end(&range); tlb_finish_mmu(&tlb); }