From patchwork Mon Jul 31 07:48:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 13333949 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 92CEFC001DF for ; Mon, 31 Jul 2023 07:39:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 32CA1280019; Mon, 31 Jul 2023 03:39:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 267D628001A; 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 CC62A280019; Mon, 31 Jul 2023 03:39:24 -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 9DEBA280019 for ; Mon, 31 Jul 2023 03:39:24 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B9DC3B1F2F for ; Mon, 31 Jul 2023 07:39:23 +0000 (UTC) X-FDA: 81071106606.23.78E4BBA Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf28.hostedemail.com (Postfix) with ESMTP id 43BD7C0009 for ; Mon, 31 Jul 2023 07:39:20 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690789161; a=rsa-sha256; cv=none; b=rSFK3M4sf+6zybGsif+hqs03VQBqvKbnAK8L6aW55sRYTHxBuDdTpVV35ZTseimfHYo6KF yjLWWAW0dB+UN8nVawRXFXiNriTtlBlB4MDJ2uDpQF7Vdz21p3XGr6FIXkPItv+HBDTtul 4mcwUT4saGW30A+LzRM9KHCRTuV1pFY= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690789161; 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=QnjtTek5fZ/4QtwvL41dNaJX0C5UFKPKxH+gNlzHWXo=; b=5UvczpVsdPnCDoJm+EKozoCCCYFkBGt+X5Rzq2DfFRS3IWbbUpqCqRsdw593JutFwClaTx 9h5q0Lv51V4keGc5b4AbsWyqJ05UryqwdIDxD/BbC6bpjonDa+CiPKS5k0hSexSwLNspJn W5JgWEVbcsitEItRXCwjJ44ZOg++zV4= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RDqmD2YBwztQSD; Mon, 31 Jul 2023 15:35:56 +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:15 +0800 From: Kefeng Wang To: Andrew Morton , Catalin Marinas , Will Deacon , Mike Kravetz , Muchun Song , Mina Almasry , , , , , CC: , , Kefeng Wang Subject: [PATCH 2/4] mm: mremap: use flush_pmd_tlb_range() in move_normal_pmd() Date: Mon, 31 Jul 2023 15:48:27 +0800 Message-ID: <20230731074829.79309-3-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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 43BD7C0009 X-Stat-Signature: st3d6sanqg4xr9jcsazgewoef1htyp6s X-HE-Tag: 1690789160-354093 X-HE-Meta: U2FsdGVkX19JYDY0QpkENLVZr0thHjOwsvkKG3HN8hQdFb0Mu/e7E/dF1R3PD96IFMFWQNBbzi/6zoDFEf0EwOmiA6HCp8Ah79rnxE7yQ+zCc3PQT/e65+UPqXQI3ix15Xj7hQNy/Le2FYbG48704pP4YFg9ffm5A6XDQkPSnS5XhJwzMerGZBFBb+KlK8TAMTkyLxH73RylJLtcBwpEQdZ0E2UqoGpJV8gFfVdcjx+WqlLkRJ8/P8VlB6Hd22qISbZywjcu8xpTeGDJzqcBvTHVRoxKQS1+tMrHiZoNrIlzxbixKoGlE6NikIYK10vbY1oJkXhlLYrQM9PW6NJip+bZnUZHxJaTHVum34Xo18S9fjVtHOM6UvQQW0ON7y1vdUpMNZYoEPjNoFjAsEZNm9tlbSiGxIIuoI5U1lwad7RA5ouEnjbGZnyARK5n4/cy0+xz5YchoNKCkEwDqevVSJ6t7Q4AROdkGSgz0713F0y79HinUw2AceXEWxUbiMexbuDlnQAYVlI/ZXZ8pqVD/feZm6qp3BjCdkXGj5Bg8mgEUDw07CbeXP5BTuc8eln2sT82HfDNpemS5SaVrBTPpvKikWXgwi3COLxEEL65FsMZTzhQX/FTn5JsIG2bzWzqBG6pxN/kaBzPraq7MlYxtLAQ3cnB9lAtsB26fqDLoiI9ZOjWiHiCOI1SoZTQz3DpbWg5ba9/kaYGBN6a48wHIQRIRt4JTW9aDm37rjJ0a/qcPJ3vBU3An4nPyWChBtB86Dh5vbBmF8GPliLYD3vbqKD/2G1Kigd9iILQ2gEDP+LxS6TYJBQiQ2gxosxtgH/Iar9Xb58Q+FvJgDdKwQN6IAWBdNHeMIcj4Sg5bxD+bSAUD50NJ2gqS2srRv7p8YwqP4CaRgcJg8/f6OeVJFZFRNBLpHzhN9Wm226aQ2/i4T7UYDfiYT0RirgVwqdYffGbtIoqtIhkluH7lTlTUN5 yt6VaQJM GL7uN2N5/T3E1kS+FP1s3xIdfGo4fr8U/4UZhWG5FLt3izhYmgJp90Lgq0X+bva48EIrQs0i3Zxu9WSgFqsCuV5HWocAb7CkW9xVaRpXPOrUQVQo9oJc2XQVSNf+kysKdHP21oSeOjQlNMMfrdhhVP9G7CdXwYvcIc+naxVQWAsgE2k+SOCu5GoO9OBLxU2Nr/jbz 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 thp tlb, so use the more applicable flush_pud_tlb_range() instead of flush_tlb_range(). Fixes: 2c91bd4a4e2e ("mm: speed up mremap by 20x on large regions") Signed-off-by: Kefeng Wang --- mm/mremap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mremap.c b/mm/mremap.c index 11e06e4ab33b..1883205fa22b 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -284,7 +284,7 @@ static bool move_normal_pmd(struct vm_area_struct *vma, unsigned long old_addr, VM_BUG_ON(!pmd_none(*new_pmd)); pmd_populate(mm, new_pmd, pmd_pgtable(pmd)); - flush_tlb_range(vma, old_addr, old_addr + PMD_SIZE); + flush_pmd_tlb_range(vma, old_addr, old_addr + PMD_SIZE); if (new_ptl != old_ptl) spin_unlock(new_ptl); spin_unlock(old_ptl);