From patchwork Tue Aug 17 08:12:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 12440829 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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL 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 9E992C4320A for ; Tue, 17 Aug 2021 08:12:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 51F4F60F22 for ; Tue, 17 Aug 2021 08:12:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 51F4F60F22 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E7D466B0072; Tue, 17 Aug 2021 04:12:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E2DD46B0073; Tue, 17 Aug 2021 04:12:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1BAC8D0001; Tue, 17 Aug 2021 04:12:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0253.hostedemail.com [216.40.44.253]) by kanga.kvack.org (Postfix) with ESMTP id BAFF76B0072 for ; Tue, 17 Aug 2021 04:12:38 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5FE5C1F043 for ; Tue, 17 Aug 2021 08:12:38 +0000 (UTC) X-FDA: 78483855996.30.C69028D Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) by imf26.hostedemail.com (Postfix) with ESMTP id 152B6200ECB2 for ; Tue, 17 Aug 2021 08:12:37 +0000 (UTC) Received: by mail-qk1-f177.google.com with SMTP id bj38so4264249qkb.9 for ; Tue, 17 Aug 2021 01:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=s8gWaJfJ4WIQanuDSV4XHG60BxCx9sgBhrowAqyXAGc=; b=NMiekobsOEwgOm3HulE+GsIzl99RzYQahhmJFly4RZa7Rcp/RO3vQlKPXR4EsRt0Wh A4E9h0z0d/fOVyHVKd1AQmLoEqzhZyLuBPZ6P/1oHXSsAw0cSzQF2oWBKeFBI++U12Tk SAV3vRG7YPWYGZrns9/CsT4lduY4sRLp7ljD80rN/9LGJ/4Zz97EJd+3fk9smW5tFgYt I4XKfbcRiRj3hb2tqEaOEcm2fUoGyqw0XdGiZW0AC1yvdCiMfKqRKOgWtNvuDMgJ20Ho ikyOqbYBBUPmjVZhYiIcj4K1IdUF+EKe6UbsZ78qiMnbcqm/7lWVj6TllIgRw/sKPxUJ ZXDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=s8gWaJfJ4WIQanuDSV4XHG60BxCx9sgBhrowAqyXAGc=; b=lw6ZnpGiqaPlrpKzq+4XCZWkfQWvoSYxyefxeFX+kJJrun36lZm2eD+Zkbr67zhOkG 0HkKVDddQ5Uxjk1TCG47TZZQJOdu/5YYNCg357tIAGn2XqTD23bxmRokolLc8mveMalF 0XFAg+qqkHhO6qVx2r6xaK4JPs8V2JqxVpNgYpni5gEXhz9hJnLgKy16KBIjJo20vLVx IZz8trcWrbH5E1riJ7IqH0z2LMQjo+VI00CTg6Q4CwiV1QRVc18kzZhnetGKk9MkCZmr mYSQ0fCQ3SWRKnRgiJBgdsKImbwpddeOXgrwWPyh0wPiIhgs3a3+pWMrJEoHwjhOI3Jk Rqkg== X-Gm-Message-State: AOAM5312nl4AviZRC2Awm00J7KQ/GwZy7GI08zK6uupfhA30XnW++LHJ wPNnlaArrSlrNky0xZTIfagLpw== X-Google-Smtp-Source: ABdhPJxVnbd3A4PYs7GXspwmAshRWlMAmJn5RmJc1m6XsPvUMZ3wXL6wVHX3SfxeuLk6rSHNu5MNJQ== X-Received: by 2002:a37:c09:: with SMTP id 9mr2543302qkm.73.1629187957273; Tue, 17 Aug 2021 01:12:37 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id x125sm903535qkd.8.2021.08.17.01.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 01:12:36 -0700 (PDT) Date: Tue, 17 Aug 2021 01:12:34 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: Andrew Morton cc: Hugh Dickins , Shakeel Butt , "Kirill A. Shutemov" , Yang Shi , Miaohe Lin , Mike Kravetz , Michal Hocko , Rik van Riel , Matthew Wilcox , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 4/9] huge tmpfs: revert shmem's use of transhuge_vma_enabled() In-Reply-To: Message-ID: <45e5338-18d-c6f9-c17e-34f510bc1728@google.com> References: MIME-Version: 1.0 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=NMiekobs; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf26.hostedemail.com: domain of hughd@google.com designates 209.85.222.177 as permitted sender) smtp.mailfrom=hughd@google.com X-Stat-Signature: zndr7kyg3jc7bwnundgxzouh9gyr4jor X-Rspamd-Queue-Id: 152B6200ECB2 X-Rspamd-Server: rspam05 X-HE-Tag: 1629187957-285353 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: 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 (one check is whether the app has marked its address range not to use THPs, the other check is whether the app is running in a hierarchy that has been marked never to use THPs). shmem_huge_enabled() prefers to show those two checks explicitly, as before. Signed-off-by: Hugh Dickins Reviewed-by: Yang Shi --- 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;