From patchwork Tue Aug 1 02:31:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13335695 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 8806AC04A94 for ; Tue, 1 Aug 2023 02:20:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76DF42800C6; Mon, 31 Jul 2023 22:20:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C1DF2800C9; Mon, 31 Jul 2023 22:20:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3ECD428007A; Mon, 31 Jul 2023 22:20:09 -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 2D83A2800C6 for ; Mon, 31 Jul 2023 22:20:09 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 018B5160150 for ; Tue, 1 Aug 2023 02:20:08 +0000 (UTC) X-FDA: 81073930938.25.D479B66 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf19.hostedemail.com (Postfix) with ESMTP id 9C5E81A000F for ; Tue, 1 Aug 2023 02:20:06 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 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=1690856407; 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=IFMGozlLYJVoltO3CseRa5j/Y+k4oC5qFh+PfUDcvBw=; b=ONC+0We2wS9qQuwz+Gh6wSR+mVOUJSNHzqo4lBrv600AwNwT+u05CT1UjL6AREiI7b+x4L QL3POraCeSJ5Ty50WPwDHAIp3XeyvAToyTLVx8aqgkIbAd6nUVtjEZxfR+K6XcemyYjpm9 b1DvHnAZvENUPLZTosr5QSwyXyD03Tc= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf19.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690856407; a=rsa-sha256; cv=none; b=1ukEyjOrO9sgcFduMPoq+f3iTpDcsqItlkk8+ud64SO9T+6ORSiuAn/j2IMbxxkQ+8U+RX FZOE0/GMz+5taFMKxfUKYojkSCqJzc8zFqJjJSRVgHW9VyJ4ohFgnp+MC1oRjhv/IQpB2c I4H6Y/zT9bT04BVSg7KMAGK2hu21cWo= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RFJh45z2lzrRx1; Tue, 1 Aug 2023 10:19:00 +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; Tue, 1 Aug 2023 10:20:01 +0800 From: Kefeng Wang To: Andrew Morton , Catalin Marinas , Will Deacon , Mike Kravetz , Muchun Song , Mina Almasry , , , , , CC: , , <21cnbao@gmail.com>, Kefeng Wang , Muchun Song Subject: [PATCH v2 1/2] mm: hugetlb: use flush_hugetlb_tlb_range() in move_hugetlb_page_tables() Date: Tue, 1 Aug 2023 10:31:44 +0800 Message-ID: <20230801023145.17026-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230801023145.17026-1-wangkefeng.wang@huawei.com> References: <20230801023145.17026-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspam-User: X-Stat-Signature: xeqtnfa5p15ng74fmd5h849yfg9oe1pa X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 9C5E81A000F X-HE-Tag: 1690856406-791378 X-HE-Meta: U2FsdGVkX1/tev29XYb8sLsLK/tWFQTk5N+tvDZ0oVnAxpzWrVi4XaVBdC7luaM0OzehNmjfLeULSZuoNZtvHAkJ6aG7HCj9xRvdM/8HgxCfbYLrenxTSPeoqGnojNbg0KeUlaMIZIYlviqy8vF9z4qQyQ46T7X4RgdSkGgdS8iBXzO7CNs7J4TUBPbgRL3VY0pXF0+6xDNV6RWG5bXuxGmtRIZdOqDS5FWu3zGr00VO2rSYFiB51UtPnBKiUHfPD+TB2s7jMbTHRP4DSzjochOscV5CNuYmKUuzPfE52jd1NfuX2+vq9afKBuhfRuMRZa0l/jGwu73AIfc189h2kd046bvbeau/5aB51uDWBpdF5IIUvvtTeiL7KdDbSOLTPm1aN9lbp+ZilMz78+oO/mAaPerwvS3TuJgSn0IZFRSDFDN0U9f81BNjCjsG+OggGwHa13MSfI/RaHTyzH/zBAGDamv208s+8FPyT35AQN8+uwI8qB0/VtymazE0GIoCIe5hPehdA97peBXGyJFveVqrAZn6ffaY04haQp/LCYyX40TXDFZYqqvVBe14gOLMkG3lWs5rYaZMZ/fpr2VY7uChjeUgOKMXuBOjV7jVutPLtipqg6Mg27Ab6sGPXmxFluRNPW4xIz9q8+dBfe+qieHoZRIW+8nUTPB6VKyVr3owxMtLHNEP4ZY28bGh5WJsn7La+kJdrLM6W88XYAJ9xb8boO0yXAMuNptIM7DP+ZAJcmxfC1DGdcjamyY/FDXS4DPdIDaicdf6/65uC2NzrVRvtYTBXjEPmHr1tkdP9mj/Z+KCEBkhh2Nk7uZXGI1iJ0RUnAROau6VSjejKV76HdNiv46sqTTN5BbkTc5jokrvC7rKS1oKE5xXLDAypkJO5zOCkf4yzscxXsYAFHS7cz33e4lrQ+FUc07K8FSDpaEeD8qgnHgTXLsWeJ5DnGkY9T/Rkf6jCoTnIgP3YML 0NZswqJI aT38uy4bySnrDDM0ABX/ci6kgmm6xSIyEBdpPOoUhjZ6hjIQtxpqN7y43I8Krk/GEg5BAlY+WpXEjML8OpKU2nS+ctrd2FubVSGH8u4Zqd7ugAap+kQF6XseYuX6m9KMTYRTcHjSXpOU+Y9DWImRT8P3j5zCkuWAAvQ4FkDV7DtBbWapJhXDqwkW+HbNWE3KnrEFr/0uJ4YDxdYozovDrDcgiiuHmvmeDoS5xwVG3A10OllE/A5GU04Fr/tGDvQ4N+1jS1EKhJWxfU0WOq9j3rnclkQ== 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(). Reviewed-by: Mike Kravetz Acked-by: Muchun Song Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma") Signed-off-by: Kefeng Wang --- 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);