From patchwork Tue Jun 28 13:28:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12898287 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 2A262C433EF for ; Tue, 28 Jun 2022 13:28:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A63248E0002; Tue, 28 Jun 2022 09:28:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9EB2C6B0072; Tue, 28 Jun 2022 09:28:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88CA88E0002; Tue, 28 Jun 2022 09:28:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 76C906B0071 for ; Tue, 28 Jun 2022 09:28:42 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4A35A976 for ; Tue, 28 Jun 2022 13:28:42 +0000 (UTC) X-FDA: 79627724484.30.E527045 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf12.hostedemail.com (Postfix) with ESMTP id 4975440030 for ; Tue, 28 Jun 2022 13:28:41 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LXQLs0xq0zTgDj; Tue, 28 Jun 2022 21:25:09 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 28 Jun 2022 21:28:38 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH v2 01/16] mm/huge_memory: use flush_pmd_tlb_range in move_huge_pmd Date: Tue, 28 Jun 2022 21:28:20 +0800 Message-ID: <20220628132835.8925-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220628132835.8925-1-linmiaohe@huawei.com> References: <20220628132835.8925-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656422921; a=rsa-sha256; cv=none; b=LkXpltsIj1xlmOT/BLgx3ujiQWHVOwU3Tj1orvN/LFBNefmLfNwypPY8oYeV/LfsS8/3f7 Ru2FIzLRBtzuXhyj1SiPAjkyrFWuy+SpLXXjDWvQGee4jd3qnImZgC4+DmgMFZ8vrh5NFw GhhIqVL+X4+xkRBGvUAOXstNAGwuRc4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656422921; 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=GGevoIVYV9j1ZCNK+fl/kf3ePw4czSSHXG1kG7dFKaU=; b=OK5sZAtNHM0XazPVN9opZwaRdvNLVamqTgV9Hs2+7oMLTmFqM9kmjPxoZjFpgw/BPjVO8s 5D4/iEs4YZjHv9vMul15ye1CDmrHGk/p4ZwdyucmHFJIUzNHlyW1eIVJegtvu4o+uGNRmi uceXIDWf1bwbVRGVFQH32F8iVlLslDI= X-Stat-Signature: gtd4a8k1jc1re3ikmme3b4dpz311c5ro X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 4975440030 Authentication-Results: imf12.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf12.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-HE-Tag: 1656422921-358334 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: ARCHes with special requirements for evicting THP backing TLB entries can implement flush_pmd_tlb_range. Otherwise also, it can help optimize TLB flush in THP regime. Using flush_pmd_tlb_range to take advantage of this in move_huge_pmd. Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song Reviewed-by: Zach O'Keefe --- mm/huge_memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 7b7eedc6d5dd..48ebeb02f7ce 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1849,7 +1849,7 @@ bool move_huge_pmd(struct vm_area_struct *vma, unsigned long old_addr, pmd = move_soft_dirty_pmd(pmd); set_pmd_at(mm, new_addr, new_pmd, pmd); if (force_flush) - 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);