From patchwork Tue May 11 13:48:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12251061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E861C433B4 for ; Tue, 11 May 2021 13:49:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B867461628 for ; Tue, 11 May 2021 13:49:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B867461628 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0ADB66B0074; Tue, 11 May 2021 09:49:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA6C36B0075; Tue, 11 May 2021 09:49:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E7856B0078; Tue, 11 May 2021 09:49:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id 339426B0073 for ; Tue, 11 May 2021 09:49:17 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E1910180ACEE9 for ; Tue, 11 May 2021 13:49:16 +0000 (UTC) X-FDA: 78129081912.23.C395D82 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf24.hostedemail.com (Postfix) with ESMTP id 96DA4A000189 for ; Tue, 11 May 2021 13:49:01 +0000 (UTC) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FffN84x6Hz1BKTv; Tue, 11 May 2021 21:46:32 +0800 (CST) Received: from huawei.com (10.175.104.170) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Tue, 11 May 2021 21:49:01 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , , , , , , Subject: [PATCH v3 0/5] Cleanup and fixup for huge_memory Date: Tue, 11 May 2021 21:48:52 +0800 Message-ID: <20210511134857.1581273-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.104.170] X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 96DA4A000189 Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf24.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.190 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam04 X-Stat-Signature: 4t7zxrwsk4hfsaez8y9egu3ufu6u33po Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=szxga04-in.huawei.com; client-ip=45.249.212.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1620740941-234696 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: Hi all, This series contains cleanups to remove dedicated macro and remove unnecessary tlb_remove_page_size() for huge zero pmd. Also this adds missing read-only THP checking for transparent_hugepage_enabled() and avoids discarding hugepage if other processes are mapping it. More details can be found in the respective changelogs. Thanks! v2->v3: collect Reviewed-by and Acked-by tag rename transhuge_vma_enabled to transparent_hugepage_active and add helper file_thp_enabled per David Hildenbrand v1->v2: collect Reviewed-by tag add missing check for read-only THP per Yang Shi Miaohe Lin (5): mm/huge_memory.c: remove dedicated macro HPAGE_CACHE_INDEX_MASK mm/huge_memory.c: use page->deferred_list mm/huge_memory.c: add missing read-only THP checking in transparent_hugepage_enabled() mm/huge_memory.c: remove unnecessary tlb_remove_page_size() for huge zero pmd mm/huge_memory.c: don't discard hugepage if other processes are mapping it fs/proc/task_mmu.c | 2 +- include/linux/huge_mm.h | 33 ++++++++++++++++++++++----------- mm/huge_memory.c | 20 +++++++++++++------- mm/khugepaged.c | 4 +--- mm/shmem.c | 3 +-- 5 files changed, 38 insertions(+), 24 deletions(-)