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 6BB02E81E1B for ; Fri, 6 Oct 2023 17:58:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1A058D00D2; Fri, 6 Oct 2023 13:58:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA4438D00C9; Fri, 6 Oct 2023 13:58:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D1ECA8D00D2; Fri, 6 Oct 2023 13:58:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id AEED78D00C9 for ; Fri, 6 Oct 2023 13:58:18 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 93B33A028B for ; Fri, 6 Oct 2023 17:58:18 +0000 (UTC) X-FDA: 81315795876.14.1C71EDD Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf17.hostedemail.com (Postfix) with ESMTP id D5F5B40006 for ; Fri, 6 Oct 2023 17:58:16 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=R3J+IEBH; dmarc=none; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696615096; a=rsa-sha256; cv=none; b=ANOHEf0Pcc1/Mfm7zYpeCnImMP7a1XhpbJNKJ9vwj/BdjXvlfaRqZgxCRLCbzGryOtmYbv KTAD5z8psINuhu4qgJR5aMd2tjZjWDf6i2l76/+Cfu3PR+voC3OpxWeoLKLxbKoObTsMap S9YhDKoLOkT4/zJERVo2ItemH3jIxNw= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=R3J+IEBH; dmarc=none; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696615096; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UdstW+Pbe3oTE+aMwbdtUq/FCmPWhrxSYwZxPLsLKlM=; b=esA+/rEO3UIhAwXNMGhvBFPST67iPTOnP0jkm4M7ZZ1qW2kzuRADVNL43xpA8HsMFYcWVS iI4UzFy08PwBn41eJT+eKek327PK2ohP71ZTWQFKBUQ3gVN7ItIMl2crLt1S65pQ1254P0 D9mvwR+gaIZGTw841ALTthfA6h9FGyM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C6B816144C; Fri, 6 Oct 2023 17:58:15 +0000 (UTC) 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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D5F5B40006 X-Stat-Signature: peqboacm7msyewa3u3hkwb37eu5jz64d X-HE-Tag: 1696615096-289102 X-HE-Meta: U2FsdGVkX19bGmmjU9nhcs3lAoOUv8rhCBthMJhS+RtccxeOuGzM4MCuyj4DfEricAySRga/FZWD526ANWRh9reoKz3+64Kaxeb/sXTUgLUD1n45FyBaxekTjbJUiV5mPjH/xDzkNUdLU6o0FcR7t62E+VtxGawApaGA1WxD07QFKCSQI2gn+6Gc00TyZhvr57oAwwugeAOdbO5Wi7X0kjyT6N+XZqv+M+iptBUUdndzToaq63Pj2dPxbfeBWeqjudArAohMDUgcw+knQ8QqWTg1qaKhPxoscAbivLg6rJQMM3/8ES0m3g3tWhxavqKoLveSugNV1CaiyQc4TDrWpz2Ko27KkuqhyLoeQEs/UviQnzxMtQ+rmtSJA8CJi+jFqkcfGT+1UNeCwd4YDOd6Mm7bwKvCvStF4ey95KQwmo+12vWMKu5R7TJ5NpiHUP6HCrIN/1CD0H/BB/Kdw3wGA9tdQmzLoP6460tSB9WpGB77CqxLyZypchoDgFsx3sUigohsn2AxKEcg9Etaey5d7uH5GNgoGvnIh2dNbpykpEH4mmSlRr08MfublSzX0PTjHOH8Df7obAmHtkhpCuRoh5CeiOLA6VG8Z6RlDqI3UTU3xtOhZWalC8421KENnV5pCUfiMDSOfXtF0C51vI68KBMrV13RfpV4vNx4vGtivqKSHqy3CdOOLpP6Bb8wLL3diLX8IxJLF39Bb9T1lwSYNR28BiKq/cL6u9AYFjHtQO2Gamaript2kx4IpOlEK8hEcUUdXXEKHT+FKeV4ZXEcWuVa73H62K4y9LTtiZBEa3i838pSj8ePmiCSHRaxLyJYQrjpdK7AuJx4lB+dyN654SaJH/tvFytg7GOQfc1LbixSw04/O1xabV84u/px4f7BeTqn9w90a9rlRxu+qE/ars9MQRbL0LsKD39IjBU6uTMJwzI6BlR3LC70OqflH5E2u4EFMcxw91zEtJ5al5+ XV5ez9WD yoSCklP+Wcu5X0BCQ9FIjsW/bJZh0xUEarUiDnv8/0LUZBGfNrm3DhkJBt4gviDyWh3ka1I2d6KIGKvZEW0/uUx869uJg5Qk1E45Kph4/qUPFzOZtIYkcDcF98jf+gcaCklZVAXkv8r1d69K05IJzmzmEs9NQzsmnn002zQlC8s7R+xdA4Tw3D1ZGF5ePLrEKJrcwENUKo/FYeVV4VDSnLPJHOvOw2i4X1z1Tpy9bNCy8yUlNagVbY3ZQpdI1ILhvAlfXVjM1fcdq5ZI= 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 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!