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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 7260EC4338F for ; Fri, 30 Jul 2021 21:57:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 599E060EBB for ; Fri, 30 Jul 2021 21:57:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232663AbhG3V5I (ORCPT ); Fri, 30 Jul 2021 17:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbhG3V4t (ORCPT ); Fri, 30 Jul 2021 17:56:49 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C297C0617B1; Fri, 30 Jul 2021 14:56:25 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id h9so3843894ejs.4; Fri, 30 Jul 2021 14:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4PGd/pIyrnd9ii9aiOJADxaPJbcRb7d0IRplRSuPHpo=; b=dbaq5a2220DjhsTlYvCWntQ0BOusszu2je5PRR9jRZn5fZr+yRsq23Oa62wfeoIgiX Fz5/2M0u+Hu5AMRBjkD4ZV1W95rTTfNhUVND6/lluArC29Yqb7QEGcSrc3KagfeIM6oJ k3zCQuQf1nOTrxLhHdW8d2w5j+9FjH+S27jAl3+Q77cWknD7Cxx9zLkzX9O93er/gvsI hA669WgZ7j9U72hd61edjgaa4l+mDW/DWhmzYj+1sHdQvWmrMVQKPNazh5zku+/Pkiit X8k+U4p2k9vndTdP3/2XCSuAH1+28A5g28+K7Rfo+fQZRElS7BmEGzbG7Qzbg+HoPfWO G01Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4PGd/pIyrnd9ii9aiOJADxaPJbcRb7d0IRplRSuPHpo=; b=Jo8oynNMzvfr+Steyz47cX67difILIa9KuLSHibEtYfppfRDebOSsgsn4pJVd4DGjq VK/6drw7s6EQfB1GTkfnUUFtqGVHsN7QXmjiYPJdoOt0/W2FZ8MrT9SajuBKgZ00XNx+ c9KAQTaH2VIujFckV06zLubd5j3BZn+w9Go+L3aCZuPpGyR2z/Rlq2jLf9m3EXDkTn9p Mjibwvl3KbDYgmFZiWJN2cPqChOVjqLeruxaCt5aKL9vsAjlYms6Y1QEJ/YlZmaLfA+Y KF8JvPO7H0ilYsIxogjLl7XaOUDncBtzeiSwfyl//9cGpnTaUVa2cUiL/0X1SB8lxsaz WJIw== X-Gm-Message-State: AOAM533eX41KLQzD9uN67K8vbpPRcdJgCsTzljZo3Y0jnuymVozmEIDj NTfHdEXjDrBiIb/zdkHjTyPMbYAvzWKMtUshdPE= X-Google-Smtp-Source: ABdhPJyXE4pPHAFxm/nipCJwTtYmXsOWVqwYGGw8YUN64nEt4hQdURUPR1ed3ZyGCzMBkcpUubQ0BaCwxY+e9DYCLMc= X-Received: by 2002:a17:906:1919:: with SMTP id a25mr4774953eje.161.1627682184064; Fri, 30 Jul 2021 14:56:24 -0700 (PDT) MIME-Version: 1.0 References: <2862852d-badd-7486-3a8e-c5ea9666d6fb@google.com> In-Reply-To: From: Yang Shi Date: Fri, 30 Jul 2021 14:56:12 -0700 Message-ID: Subject: Re: [PATCH 04/16] huge tmpfs: revert shmem's use of transhuge_vma_enabled() To: Hugh Dickins Cc: Andrew Morton , Shakeel Butt , "Kirill A. Shutemov" , Miaohe Lin , Mike Kravetz , Michal Hocko , Rik van Riel , Christoph Hellwig , Matthew Wilcox , "Eric W. Biederman" , Alexey Gladkov , Chris Wilson , Matthew Auld , Linux FS-devel Mailing List , Linux Kernel Mailing List , linux-api@vger.kernel.org, Linux MM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 30, 2021 at 12:36 AM Hugh Dickins wrote: > > 5.14 commit e6be37b2e7bd ("mm/huge_memory.c: add missing read-only THP > checking in transparent_hugepage_enabled()") added transhuge_vma_enabled() > as a wrapper for two very different checks: shmem_huge_enabled() prefers > to show those two checks explicitly, as before. Basically I have no objection to separating them again. But IMHO they seem not very different. Or just makes things easier for the following patches? > > Signed-off-by: Hugh Dickins > --- > mm/shmem.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/mm/shmem.c b/mm/shmem.c > index ce3ccaac54d6..c6fa6f4f2db8 100644 > --- a/mm/shmem.c > +++ b/mm/shmem.c > @@ -4003,7 +4003,8 @@ bool shmem_huge_enabled(struct vm_area_struct *vma) > loff_t i_size; > pgoff_t off; > > - if (!transhuge_vma_enabled(vma, vma->vm_flags)) > + if ((vma->vm_flags & VM_NOHUGEPAGE) || > + test_bit(MMF_DISABLE_THP, &vma->vm_mm->flags)) > return false; > if (shmem_huge == SHMEM_HUGE_FORCE) > return true; > -- > 2.26.2 >