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 8A220C433EF for ; Fri, 17 Jun 2022 17:54:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1CB9C6B0071; Fri, 17 Jun 2022 13:54:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 179DB6B0073; Fri, 17 Jun 2022 13:54:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06AB76B0074; Fri, 17 Jun 2022 13:54:48 -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 EC0FF6B0071 for ; Fri, 17 Jun 2022 13:54:47 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id AB489734 for ; Fri, 17 Jun 2022 17:54:47 +0000 (UTC) X-FDA: 79588478214.31.F63E50C Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf23.hostedemail.com (Postfix) with ESMTP id 3D188140097 for ; Fri, 17 Jun 2022 17:54:47 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id f8so4473506plo.9 for ; Fri, 17 Jun 2022 10:54:47 -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=5DkCs63NFpqTLIrGdt5m39QmUafD6hOga8O2FvkV3crRGCAX8ks+G+bbLiheNqmVeP mRQcKTt0wYK+AmG0ZUnklDB18Y0ej2XCe/fUBNbTJeXOW+i01w5zpOsB4KXl1na/3WJ3 kN+6dnzj63I6uNpT7n7gj7uHekRuIr6eZrlRqemkx296Pmvx1NQTUaRWAbiCbXGcfAbg I3+1/wjylzvCOropEsab4tfw01T4/Em5Q0GnWCGtiDZI+u9zDYtxMZhxxYMRrsmZTF5g 5seEPHHg9EEWMRaYQD8IYXv6V7TdhNHGzIByd1AaYKlPU8ElBRfl35sw4+MJEtBMZYlt aGxQ== X-Gm-Message-State: AJIora8XXovmIEmTC9e0IXpvP+ZIAvni5ocgFZGmwsrM+r4RcyJChl7s Uyg210oEqULrB1z6Ad2xvyMNTcir2ZuyI242JmY= X-Google-Smtp-Source: AGRyM1uLvqf1RYrXRxCniewV8UG56bLn7cL9qqmDOYYqSGNvsaGfPis3g+CKrjY0mfsarm8UC+Gv4wo15BYCcA9v/KI= 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" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655488487; a=rsa-sha256; cv=none; b=MPkvjcxeFe8/b+JzHvHnaIZZxkyP+gGV4s1s9wqM4v7JSWoHCVIKg/n6ojlT+8ptW43hmI lFg73Rdv0VMASkOraq8eFlG1FgiWt+Uh9q0952XRO1eG8ZV5t/xBPjkYHH/jsWIVJZsIEx k5B4lmd1GMEF5bo68hSXedOeJRdNaJg= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ir8ob8eS; spf=pass (imf23.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655488487; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3gaN4rlZjv7pyoxx/10QhPxWmkyRNv+DWEp7dRnF2tA=; b=bg6f6bPSktZ9rYqrI+Zqm00zu2ktxmMgy0nG0oM+SJQVZiQmYzidVKY44JDk4HZ6EPEhPz NxEOvuhhNNnT8bylWpGD1xNdIw3nCgKjRlsLGgAhgdWp9TSfIqnBM9KnRgUSqurzqz4wWQ GzCXD/U77qBFUDA2QHFhQy/U7vnXMq4= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3D188140097 X-Stat-Signature: cd63froimzt8sjgft6b3ere5ryx46rqf Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ir8ob8eS; spf=pass (imf23.hostedemail.com: domain of shy828301@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=shy828301@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-HE-Tag: 1655488487-639735 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 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