From patchwork Mon Jul 31 07:48:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13333950 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 A433DC001DE for ; Mon, 31 Jul 2023 07:39:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8CBC28001C; Mon, 31 Jul 2023 03:39:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D3CB228001A; Mon, 31 Jul 2023 03:39:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDBAB28001C; Mon, 31 Jul 2023 03:39:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A2B2F28001A for ; Mon, 31 Jul 2023 03:39:25 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 7BD35401A0 for ; Mon, 31 Jul 2023 07:39:25 +0000 (UTC) X-FDA: 81071106690.08.AA65F2B Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf27.hostedemail.com (Postfix) with ESMTP id 49C6740015 for ; Mon, 31 Jul 2023 07:39:22 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690789163; 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; bh=Yj4az2ALhhEyvky0TbaSWKAJzQx3pWTWZySo+ZOZ/q0=; b=DyuIud4t4rzv4lW4lkh6gULsacrYrRm1L8uc4EkUSVI2ZP3Ie2JjNPP0/IenQazDS47gs7 /TBlLVwv11280AQlD6wPXd9ri+L42ywDjjbffBXLnCkZV5GbshTv9LGtFvfyvTuBvjfyXY DRYwxN17Hogldx6La5pHaunUljzSwng= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf27.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690789163; a=rsa-sha256; cv=none; b=dTzfGQT0i/FYxVmHGtkzH4aDefjcIE8S3ke5zBjyGqqCsfm7YW6lqFA+vq7iO3Z9FkWLG1 HAYLjL51l40OhBBJOOYNFXNhGjb1Kw56cALwlijBN9k13Y51KyZJrU+EBotPfcI5LVAC8i 3WUipPLxXWSKHBzR2+E1iyo2eW4SUxI= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RDqm627jmzNmP9; Mon, 31 Jul 2023 15:35:50 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 31 Jul 2023 15:39:14 +0800 From: Kefeng Wang To: Andrew Morton , Catalin Marinas , Will Deacon , Mike Kravetz , Muchun Song , Mina Almasry , , , , , CC: , , Kefeng Wang Subject: [PATCH 1/4] mm: hugetlb: use flush_hugetlb_tlb_range() in move_hugetlb_page_tables() Date: Mon, 31 Jul 2023 15:48:26 +0800 Message-ID: <20230731074829.79309-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230731074829.79309-1-wangkefeng.wang@huawei.com> References: <20230731074829.79309-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 49C6740015 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: ntf6qnh4if8sp8ymfjstztyr3h44ihzx X-HE-Tag: 1690789162-24396 X-HE-Meta: U2FsdGVkX1/b6kPo8dowcR8g+C47ql1/8ag0ltB7eP4HGWTOHbQdrmh4oNJ9aShdtWLb7g2Ll+7etHsyNM0aoaK4JFEqYW3dx9aSUPKXe3zH5f0VYiofR/kGKm4EV0Ow5e07ugQIapSVewdY7QYsytF5RtXeu31yklxTvCRbTRtbW7Ad2yWtIprpRhLUpxA3maxeEOcCAlHWZN7DEiNwmHXCi3Aj+kPRYPsNa0T8e1pw+2ZFmdepVPosgdl5qRypBgxN/DieTiv7f6F0Jb3mx54wU0Mq53A6qvetqcpKhbLyrjcbuXfF/cSN/MXns6vnWD1jHvVvpZCEsjiaGhOiA4ct25m9B7DFVVwwagPuQXFrOSzOQMiBITS/Twwl2BptZVRRzNlp0qSptDembxa2Sjj386pR6jNBGC7A9D2Of35RCJwwV4z8OwPVgbrbg9xFaYuNF/UCuURexmgZXt2NpVqRBW9Lw6ihH0OnXyFmslONHcSt3k4PNYe22YZds2s8yhJxbRCcuPaUq804KMDk+s+wxZJizmmmWxsiT9VFh3VbaGkWdC3cN2NqwNY4jEolsQkQkucad/3C1vm9S96Yb0P7QP8HPyzPKugloubg9msWLkhBXB3wOmL6VYvS93GI7epnCIIoq+Yrx7cs1EaqhHJcXpHppuI9Z+hECk6SxrxX+Ub3Y952dWGolIjEkl8qYU1lnhacHlZEVP01y/y/R7oYzX+KAYzyEm0hVQ48zxQnmZxOi0Mxhd+GlShRO2SSBTD/86KXe86OUwIRAVLwP2N+JSlS1wnYX1vHh2izxz6TXvtSmr5eqJI1Z15oM5tCbSCNaWwe3jM44RjtiRKr4ATjkpJEp4fKDH7G4ggVPvhINgzZouatfcqGYupRBjp4ieehJQqACckcsyBmxn07LNfjPUsqfjMvvfwsVWgvqnhTQDcJyCNMllbnhZK0DvstUb6egb6MED3E8xQNFFX 4TLukUSz jdBZoOrfJE7ojMpbJ/f3WtcSzh6D/RFrkE9LBwC4HE6ro8Hbd9FUTASW9NfrCOdagGXEQK71ejEammYyhBFwpOMhkRqhRVZBc+ryHmE9ksH5qWy+LWHgqJIkqSfmP0tIYIV+AlSRTgGlQRaSo0QrZURYW6K2Wgn1eFbmLoN80blAbjlvLlVYz4JwCZ00GUOOi2idR 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: Archs may need to do special things when flushing hugepage tlb, so use the more applicable flush_hugetlb_tlb_range() instead of flush_tlb_range(). Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma") Signed-off-by: Kefeng Wang Reviewed-by: Mike Kravetz Acked-by: Muchun Song --- mm/hugetlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 64a3239b6407..ac876bfba340 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5281,9 +5281,9 @@ int move_hugetlb_page_tables(struct vm_area_struct *vma, } if (shared_pmd) - flush_tlb_range(vma, range.start, range.end); + flush_hugetlb_tlb_range(vma, range.start, range.end); else - flush_tlb_range(vma, old_end - len, old_end); + flush_hugetlb_tlb_range(vma, old_end - len, old_end); mmu_notifier_invalidate_range_end(&range); i_mmap_unlock_write(mapping); hugetlb_vma_unlock_write(vma);