Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4501063pxy; Tue, 27 Apr 2021 06:34:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCuC1S3QJKOmuMwhybjQLr1N7cMJZEuvTNkyZfdAgk7tYIOJ52+AO51bCRJMKTKBhit7AX X-Received: by 2002:a17:90b:1183:: with SMTP id gk3mr26516792pjb.172.1619530496939; Tue, 27 Apr 2021 06:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619530496; cv=none; d=google.com; s=arc-20160816; b=rEggdt7AOW+W/tK6AAfUGs2eAyhOR52E/mlBSza9k6tyWv/YxJj/cxWZqKlmxy7/9e t4EYvyjQnpQAEy8X/s4G3wF98+dVhtpni0vgN8zYX47IWv/taP/1p9h4P9Esn2Gm3vFy tq75um4M4vYo0OG5GiWN94BBvif3WOfAtlbXRs7p5M1IT1tv6801+FSUCO9WnSWtXXw0 s5F9TN6sknDHqnmrlSInmMzhHsiq/1OLsbuXTzdfF2xqDEapcb5Rq/pBUrtyO5jK01nv zFbhZamcTu8dV55PKDbWTqxzrd4y4kiKCoM5ozsWVQeuDKbza626v6nDU5fqFDjadd3E J5Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NRRvRZSxQeLgRH645/4DueacUkjG2dsSCD4/2JCl58M=; b=zMbBBsLVxCt4f7jCOEBD/NgWvaX13brXzY05c0GNFhiIhCvyMr+6bi7b5b5dq7HyPZ U118ll5Dwi1VnE/nFejuSkWjjs4fByQ4eyeWDIGi61ulZcD7gnXMwUIFxFtgUWuClq0A 7Iphg2KL12u+BGf1VepETPwcABW45EwrkTewkuWGalIPNgW2ONdOF1Jk56OKnNlq3yMw DwL0rnm6ciwXVHcqrd3VHQMt2Q/65mqH7bq2RmCDwvu6MXiALFWEpXn3bigWqp6A0tkC +slVhGn3n3PvpuQy2KaPAgxlkJd6z7AAH2zOfmZHDqEc2wpYL0CT9T4Y1otQ+4v4JLLE Misg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si3683857pjn.169.2021.04.27.06.34.44; Tue, 27 Apr 2021 06:34:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236513AbhD0Nd2 (ORCPT + 99 others); Tue, 27 Apr 2021 09:33:28 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:17045 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237915AbhD0NdU (ORCPT ); Tue, 27 Apr 2021 09:33:20 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FV2fv5QyRzPtF3; Tue, 27 Apr 2021 21:29:27 +0800 (CST) Received: from huawei.com (10.175.104.170) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Tue, 27 Apr 2021 21:32:25 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , Subject: [PATCH 4/5] mm/huge_memory.c: remove unnecessary tlb_remove_page_size() for huge zero pmd Date: Tue, 27 Apr 2021 21:32:13 +0800 Message-ID: <20210427133214.2270207-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210427133214.2270207-1-linmiaohe@huawei.com> References: <20210427133214.2270207-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.170] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit aa88b68c3b1d ("thp: keep huge zero page pinned until tlb flush") introduced tlb_remove_page() for huge zero page to keep it pinned until flush is complete and prevents the page from being split under us. But huge zero page is kept pinned until all relevant mm_users reach zero since the commit 6fcb52a56ff6 ("thp: reduce usage of huge zero page's atomic counter"). So tlb_remove_page_size() for huge zero pmd is unnecessary now. Signed-off-by: Miaohe Lin --- mm/huge_memory.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index aa22a0ae9894..f652be6ecca3 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1677,12 +1677,9 @@ int zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma, if (arch_needs_pgtable_deposit()) zap_deposited_table(tlb->mm, pmd); spin_unlock(ptl); - if (is_huge_zero_pmd(orig_pmd)) - tlb_remove_page_size(tlb, pmd_page(orig_pmd), HPAGE_PMD_SIZE); } else if (is_huge_zero_pmd(orig_pmd)) { zap_deposited_table(tlb->mm, pmd); spin_unlock(ptl); - tlb_remove_page_size(tlb, pmd_page(orig_pmd), HPAGE_PMD_SIZE); } else { struct page *page = NULL; int flush_needed = 1; -- 2.23.0