Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp677641iog; Fri, 17 Jun 2022 11:03:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tcvgXpCNRH3vcQfyh+ODsg60OQORhS+Mb8U823cT2Zfn9UpgZnLka6xvhQIyUoPBjqDx6M X-Received: by 2002:a05:6a00:15d3:b0:51c:1a20:f8d8 with SMTP id o19-20020a056a0015d300b0051c1a20f8d8mr11227392pfu.57.1655489033478; Fri, 17 Jun 2022 11:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655489033; cv=none; d=google.com; s=arc-20160816; b=LB4rf7Srri0ksCZiQoumABC5OnJcCcORghbSC34yUTT/DBQbtToTn5VVOe8b+Q0Mhf 1YySoMwUSmZ9hMFx4JnKtr5Jm2PXVEI0sbimqNfvB/dxbCqHaDzDuDCr2JpiV0zbu/kN UW4j1AmkFNucIkahyNtGKiuUkRWo/mkk9tV5LzunWOLw3Wb7VyL+8oVpYT8260vHjt4n 8rlhMj9VNwoNstRbwK7Yv41Cbxyp9u8ItQYKqfmke6TuQ+pnMlMiLCIIBol5OcCdTYeN iqowF6Tv+MpeJ+SYmyqV80JQBNXxYLjg/X83wNS5m024EI9HfGmfb0wc2KsM1bc1d57x xJeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3gaN4rlZjv7pyoxx/10QhPxWmkyRNv+DWEp7dRnF2tA=; b=AjtjWkXoenZECn42xF8lyK+N1q03dTy3o4DcSWeoIViqPVVB5aH2YJmSTWCY0dTzXt Cfvj8UoYYbU9iOZ6GgRM1e+wng8R2cSfG+Kwp5lAxKTgymgwn6OtwpU2YUfULNUHD0f2 Yk1C7+kOOMsJzwbTAZTYj24suSXKMsd5E/X/wxndOVJMo4aoaSXP/+E/JAF0Q0B3B2St kgDtipaSXorOtqCY9+BkHX3asTy6JTmLSLVO7DG5jJDImwSDWlu+3eCbYLxi4/jIkrvc zuYPIWDQ6q6gXMmzk8LWkQUcqdjgGT0xMSarpLFA0BaTJDcms7OoMDHsinKD0CX8OEaJ UJtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ir8ob8eS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a63d40d000000b003f8a46f7eebsi6440248pgh.497.2022.06.17.11.03.40; Fri, 17 Jun 2022 11:03:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Ir8ob8eS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232176AbiFQRys (ORCPT + 99 others); Fri, 17 Jun 2022 13:54:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbiFQRyr (ORCPT ); Fri, 17 Jun 2022 13:54:47 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A59884990F for ; Fri, 17 Jun 2022 10:54:46 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d13so4457612plh.13 for ; Fri, 17 Jun 2022 10:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3gaN4rlZjv7pyoxx/10QhPxWmkyRNv+DWEp7dRnF2tA=; b=Ir8ob8eSfXh/HH50s8vvCR020YJRMHfOP3T/X6FrfKhlN8Zm6jUKaXQTbgdebNcmq0 mcuehygwrlVmwX92zJWUlGPMOkowxPtSVcSjaVkBqF1eGcrDaBTr4t2Dnf15asqGF1RN rzVzYVG5pBiUrJMQ4qbz7eUF8+Cx2oXEOdhXwd5aBbVKekwD1x0xQ0KYp331g41Bs6Z7 pEGkUprw11PBDP66jvs+3i49greyGtXumHLEi3Hu6x2q9G+1kJT9kG/i5KsduQhJ0JkR uMb6aPUawgQDbLYQG/iXz8cVxigb7sc5Hz7jkDiaTCjsPCJ6i5IgHo/Y+ksXThmB5ji1 zJlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3gaN4rlZjv7pyoxx/10QhPxWmkyRNv+DWEp7dRnF2tA=; b=0SemflLIjwSK7lW8Z+gTi+uI9zSRqEuXe4yUo8WlZLXy7mxaoiDA2NByVccH76yTe/ ZiV6B4hWrV8mwzATHW2U/tfQGzGmPTbdMAa8dQ3Bkjliwuy91sO5VYAgw7SZdr+/x0P+ 8KjHXobwr3dBj/sF7Byfic68GxYlB1Pi5KYyom9odqSmw7bEWGI+zaq+AyrC8f5mLob9 /a8ITQDwEh4B8sw+o+axbmpOSmGSDznVQH41XB5FsMCF2glhjf1KQkT9o0BLURiPmYxq 70Jq4kKRrYS6vdots4cNu//1+FDIJYtievJLiAwqFkmYK02XzIy5CW0cNn8IMpLxkdfQ qBDw== X-Gm-Message-State: AJIora/+aXSdUMbpuDl9YmuwO21gaiqnDD2NEiBRntZjnkn6xPlt+vkN /cZ9AddSw7OKHzL2i0wIwLFw+ED9paQE+Wzgy0qZZuRI X-Received: by 2002:a17:902:8492:b0:167:6cbf:145b with SMTP id c18-20020a170902849200b001676cbf145bmr11084646plo.26.1655488486189; Fri, 17 Jun 2022 10:54:46 -0700 (PDT) MIME-Version: 1.0 References: <20220616174840.1202070-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Fri, 17 Jun 2022 10:54:33 -0700 Message-ID: Subject: Re: [mm-unstable v5 PATCH 0/7] Cleanup transhuge_xxx helpers To: "Zach O'Keefe" Cc: Vlastimil Babka , "Kirill A. Shutemov" , Matthew Wilcox , Miaohe Lin , Andrew Morton , Linux MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 16, 2022 at 4:08 PM Zach O'Keefe wrote: > > On 16 Jun 10:48, Yang Shi wrote: > > > > v5: * Removed transparent_hugepage_active() for !THP, per Zach. > > Patch 4/7 and 5/7 were updated accordingly. > > * Collected review tags. > > v4: * Consolidated the transhuge_vma_size_ok() helper proposed in the > > earlier versions into transhuge_vma_suitable(), per Zach. > > * Fixed the regression introduced by patch 3/7, per Zach and Miaohe. > > * Reworded the comment for transhuge_vma_suitable(), per Zach. > > * Removed khugepaged_enter() per Miaohe. > > * More comments for hugepage_vma_check(), per Zach. > > * Squashed patch 4/7 (mm: khugepaged: use transhuge_vma_suitable replace open-code) > > in the earlier version into patch 2/7 of this version. > > * Minor correction to the doc about THPeligible (patch 7/7), so the > > total number of patches is kept 7. > > 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. > > > > 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. > > > > > > Yang Shi (7): > > mm: khugepaged: check THP flag in hugepage_vma_check() > > mm: thp: consolidate vma size check to transhuge_vma_suitable > > mm: khugepaged: better comments for anon vma check in hugepage_vma_revalidate > > mm: thp: kill transparent_hugepage_active() > > mm: thp: kill __transhuge_page_enabled() > > mm: khugepaged: reorg some khugepaged helpers > > doc: proc: fix the description to THPeligible > > > > Documentation/filesystems/proc.rst | 4 ++- > > fs/proc/task_mmu.c | 2 +- > > include/linux/huge_mm.h | 80 +++++++++++++++++++---------------------------------------- > > include/linux/khugepaged.h | 30 ---------------------- > > mm/huge_memory.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- > > mm/khugepaged.c | 84 +++++++++++++++++++------------------------------------------- > > mm/memory.c | 7 ++++-- > > 7 files changed, 130 insertions(+), 158 deletions(-) > > > > Series LGTM. Thanks for these cleanups, Yang! Thank you so much for reviewing the patches. > > Best, > Zach