From mboxrd@z Thu Jan 1 00:00:00 1970 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 F357CC43334 for ; Fri, 10 Jun 2022 07:08:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 639248D007B; Fri, 10 Jun 2022 03:08:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E8FB8D0064; Fri, 10 Jun 2022 03:08:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D7D98D007B; Fri, 10 Jun 2022 03:08:15 -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 3E81A8D0064 for ; Fri, 10 Jun 2022 03:08:15 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 0DBF0601A2 for ; Fri, 10 Jun 2022 07:08:15 +0000 (UTC) X-FDA: 79561447350.22.7934FE9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf25.hostedemail.com (Postfix) with ESMTP id 437A6A007B for ; Fri, 10 Jun 2022 07:08:13 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LKBmQ4XzSzRhX2; Fri, 10 Jun 2022 15:04:54 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) 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; Fri, 10 Jun 2022 15:08:08 +0800 Subject: Re: [mm-unstable v3 PATCH 0/7] Cleanup transhuge_xxx helpers To: Yang Shi CC: , , , , , References: <20220606214414.736109-1-shy828301@gmail.com> From: Miaohe Lin Message-ID: <8ca53494-090f-a415-86cb-c942edfb89af@huawei.com> Date: Fri, 10 Jun 2022 15:08:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20220606214414.736109-1-shy828301@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654844893; a=rsa-sha256; cv=none; b=zc1TUUd7jbjuaqvh/EGVFmMpgoda0YHmVYEQzIsga688kXGsQ2lWXXiP/DhLklA1io2WCL 3xoTnaKYs3RbGB0m9H3oUi4FC6wE6E7vMXdhh/S199cVYkO6P3uRc3G/Q8BHZ7oIqxmaXj hqlADA6oVfmTJVRv8rznNvtY0j9kVhI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@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=1654844893; 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=RuStos1BRA9UZSBFApCqnCETfahUnn+hs8g3nzS5B8A=; b=Kan21LJsmSsfbXKfK3dPclDxIDTulfloIm8VOyP+Sk7iCOrZjcYYNaMjQhrfsDMebiUiR/ 5RSj2SQ77wRIjOdGS2TtgrGod8Ajj/3tRoJ4ScYXaMO9DW3VZQ6EEkqxNRqY4CqaSKqPPj a885cqVmZx1YNef2t5AT8Njc/7JiaBY= X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 437A6A007B X-Stat-Signature: cqgwahywi6sk6wkheb3zfkjxi3dfcqcu X-Rspam-User: Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1654844893-137193 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: On 2022/6/7 5:44, Yang Shi wrote: > > v3: * Fixed the comment from Willy > v2: * Rebased to the latest mm-unstable > * Fixed potential regression for smaps's THPeligible > > This series is the follow-up of the discussion about cleaning up transhuge_xxx > helpers at https://lore.kernel.org/linux-mm/627a71f8-e879-69a5-ceb3-fc8d29d2f7f1@suse.cz/. > > THP has a bunch of helpers that do VMA sanity check for different paths, they > do the similar checks for the most callsites and have a lot duplicate codes. > And it is confusing what helpers should be used at what conditions. Yes, these helpers really confused me when I read the code. Thanks for doing this! > > This series reorganized and cleaned up the code so that we could consolidate > all the checks into hugepage_vma_check(). > > The transhuge_vma_enabled(), transparent_hugepage_active() and > __transparent_hugepage_enabled() are killed by this series. > > Added transhuge_vma_size_ok() helper to remove some duplicate code. > > > Yang Shi (7): > mm: khugepaged: check THP flag in hugepage_vma_check() > mm: thp: introduce transhuge_vma_size_ok() helper > mm: khugepaged: remove the redundant anon vma check > mm: khugepaged: use transhuge_vma_suitable replace open-code > mm: thp: kill transparent_hugepage_active() > mm: thp: kill __transhuge_page_enabled() > mm: khugepaged: reorg some khugepaged helpers > > fs/proc/task_mmu.c | 2 +- > include/linux/huge_mm.h | 84 ++++++++++++++++++++++++++++------------------------------------------ > include/linux/khugepaged.h | 21 ++---------------- > mm/huge_memory.c | 64 +++++++++++++++++++++++++++++++++++++++++++++-------- > mm/khugepaged.c | 78 +++++++++++++++-------------------------------------------------- > mm/memory.c | 7 ++++-- > 6 files changed, 114 insertions(+), 142 deletions(-) > > > > . >