Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp550334rdb; Fri, 6 Oct 2023 10:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG18jAZ1wqYYoA/l7JFrStAndFO+MeVduJr/wQeVzLnSbceVkxcHftGgytOttk+2Dq24gvo X-Received: by 2002:a05:6358:2624:b0:15b:249:b520 with SMTP id l36-20020a056358262400b0015b0249b520mr8865214rwc.7.1696615113280; Fri, 06 Oct 2023 10:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696615113; cv=none; d=google.com; s=arc-20160816; b=hi1x0CWz7xxOpjDCWN8ZO3nAG70scxNZtHaFHBQTVgl2g+qqv2MzMgkfGF22SPcyan FOd/lv7Mw510qTPFshgOL7NUWvW7L/lnIodOH2c6hVS0zHTudZUp68bYThum/5weBx3Z Z4EtaxCap7wYDaOpBX3brhpcFi6UyKPMLY66qa1CQJzFUpk4uufWrVtNrgjIa90gYzT1 syEXXiioyAkRnYqgtGdvON9OQhDlhgyOvni+MtscVhS85Ndl3ThDcBOU5nvmFwQDDMFu 5VtpWVSioPRYrpfi1e6QIwCXHglJ93U6l8GKNId0sdcVa5UFQlnItYe/41hW7EPml1al ERrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=UdstW+Pbe3oTE+aMwbdtUq/FCmPWhrxSYwZxPLsLKlM=; fh=J5L+16pARp+xhJzMyJxVR15WC1EdN1nI6NvofjyVJyI=; b=IlFvCrUwmyEynJ8SsMyJT+0zoJHzLkxpW6vaVEDwfo4lwWLI72tWK/1SNpsiv9D4Uo QW4OXka6U43kQlp5nQ/JK2LvGagcHM18y3ig881xArsu4X3C2lm5GTRQ5ZoitY9/W9S1 YawEwyJHBg9u2XtGppCKF36HmZeQ5Et1p2GiRxIHY80fnnc1LYaULnnOXQTTkATLlJty gEfOVU9DRCPFBB1RYbGrzLGfNwSgjZLl6H4lu8kjpoW+ZvGFl5wUGD+3NC7bZC0J1E9A wU1a6oJTLG2yiTGUvi8S59Nsx0xHya+vSOjvvdmGljUkzTSt45WfnTOwZguw7bu27gmI W+cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=R3J+IEBH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id w23-20020a63f517000000b00578c64433d5si3930111pgh.877.2023.10.06.10.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 10:58:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=R3J+IEBH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id AF79C8179075; Fri, 6 Oct 2023 10:58:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233149AbjJFR6S (ORCPT + 99 others); Fri, 6 Oct 2023 13:58:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233127AbjJFR6Q (ORCPT ); Fri, 6 Oct 2023 13:58:16 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99062F2 for ; Fri, 6 Oct 2023 10:58:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AD3EC433C8; Fri, 6 Oct 2023 17:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1696615094; bh=/dh5o3vWItJHeqi+Jctz9Aohs2n01RWuS4p9vbXTwxk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=R3J+IEBH4g7L6uACK+OXDCCPlXx1KjCksohxDjEEzAIPhkzKTJuePVliCGN/x4iVx Z8j6+p/4BAOFu86exLeYgqHNbWjUgjm5aJLhxAcDOCXFE60ShxCPMSdcyu9s+79jUp RC4fBwVB+kk51aLQYpmZJNa27w6Pyn3t8G4ZJcy4= Date: Fri, 6 Oct 2023 10:58:10 -0700 From: Andrew Morton To: "Zach O'Keefe" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Saurabh Singh Sengar , Yang Shi , Matthew Wilcox , David Hildenbrand , Ryan Roberts Subject: Re: [PATCH v4] mm/thp: fix "mm: thp: kill __transhuge_page_enabled()" Message-Id: <20231006105810.17fcb352e33cbcab1645099b@linux-foundation.org> In-Reply-To: <20230925200110.1979606-1-zokeefe@google.com> References: <20230925200110.1979606-1-zokeefe@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 06 Oct 2023 10:58:30 -0700 (PDT) On Mon, 25 Sep 2023 13:01:10 -0700 "Zach O'Keefe" wrote: > The 6.0 commits: > > commit 9fec51689ff6 ("mm: thp: kill transparent_hugepage_active()") > commit 7da4e2cb8b1f ("mm: thp: kill __transhuge_page_enabled()") > > merged "can we have THPs in this VMA?" logic that was previously done > separately by fault-path, khugepaged, and smaps "THPeligible" checks. > > During the process, the semantics of the fault path check changed in two > ways: > > 1) A VM_NO_KHUGEPAGED check was introduced (also added to smaps path). > 2) We no longer checked if non-anonymous memory had a vm_ops->huge_fault > handler that could satisfy the fault. Previously, this check had been > done in create_huge_pud() and create_huge_pmd() routines, but after > the changes, we never reach those routines. > > During the review of the above commits, it was determined that in-tree > users weren't affected by the change; most notably, since the only relevant > user (in terms of THP) of VM_MIXEDMAP or ->huge_fault is DAX, which is > explicitly approved early in approval logic. However, this was a bad > assumption to make as it assumes the only reason to support ->huge_fault > was for DAX (which is not true in general). > > Remove the VM_NO_KHUGEPAGED check when not in collapse path and give > any ->huge_fault handler a chance to handle the fault. Note that we > don't validate the file mode or mapping alignment, which is consistent > with the behavior before the aforementioned commits. > > ... > > @@ -100,11 +100,11 @@ bool hugepage_vma_check(struct vm_area_struct *vma, unsigned long vm_flags, > return in_pf; > Ryan's "mm: thp: introduce anon_orders and anon_always_mask sysfs files" changes hugepage_vma_check() to return an unsigned int, so this patch will need some rework to fit in after that. However Ryan's overall series "variable-order, large folios for anonymous memory" is in early days and might not make it. And as I don't know what is the urgency of this patch ("mm/thp: fix "mm: thp: kill __transhuge_page_enabled()"), I'm unable to decide which patch needs to come first (thus requiring rework of the other patch). Please discuss!