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 072A3E81E1B for ; Fri, 6 Oct 2023 17:50:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 550216B0292; Fri, 6 Oct 2023 13:50:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 500146B0294; Fri, 6 Oct 2023 13:50:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C8076B0297; Fri, 6 Oct 2023 13:50:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 2CA5E6B0292 for ; Fri, 6 Oct 2023 13:50:25 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EB670B3FF5 for ; Fri, 6 Oct 2023 17:50:24 +0000 (UTC) X-FDA: 81315775968.24.244DD8A Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf04.hostedemail.com (Postfix) with ESMTP id B472B4001A for ; Fri, 6 Oct 2023 17:50:22 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=sD7RhdIt; dmarc=none; spf=pass (imf04.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 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=1696614623; 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=bxlZ09x94ak6N7YKNqDts0QfjjwSKqroa5h5VtkR3jU=; b=ev+882v6BJ5nF8jtfuXaButIpHl4+FDvESqHUtpxUP/wshTmdR2CcPD8UpssLoXLHl0+uK Q36sRNLSGiWeoAt2/u82bZGr92FhCgZ56kCYMQ8GF4b5F0Yiml7ouT9rFpgsJMz/Klulqw XFqA8DLenIJPPP4kKJV88zaQnjW8Hd8= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=sD7RhdIt; dmarc=none; spf=pass (imf04.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696614623; a=rsa-sha256; cv=none; b=3Aa2pdOOB4EMvPFrH2ahs+1/II47X2jiPcsH0ydHlLxOyR2A/J5RwQO1RHNoegy3VjhZE6 iWHkzt24TUcTMI5/WF/3iOTUeJVO1xP0agWEtlsmxadXbCwy0rLD+Q5ubZTCRTazhZcanL wIkEEwxJPIal+rgV4LsIcB+gb8PBlrI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1793CCE2571; Fri, 6 Oct 2023 17:50:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C3B4C433C8; Fri, 6 Oct 2023 17:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1696614617; bh=ezaBAA978dV4qGKI1Hk+XVCJoI17xD2mQigx1z5Hii0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sD7RhdItpYC6z9S8pZzd51a6UkqXvBynRqpuACzS6cBLRdc/z1Kor2vgtMwhB5LUO vMPleiMLFKRgVnBMUF37r6iuKjN8uUFs7vdjvSvWWs/34voXRZ9id779z5Ck1L2d1i aGtJNydxuewIGcWQCbBiDJINd/8qAvVaiBgsFca8= Date: Fri, 6 Oct 2023 10:50:12 -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 Subject: Re: [PATCH v4] mm/thp: fix "mm: thp: kill __transhuge_page_enabled()" Message-Id: <20231006105012.61a12beefaa0f9a5adc8299f@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-Rspamd-Queue-Id: B472B4001A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: dpzg5nwahfdw38hqgoe9a8ofmpx5iii8 X-HE-Tag: 1696614622-970884 X-HE-Meta: U2FsdGVkX1+Qzq9iK1H7h79sl1wxqVw9GIZ75US4e/GHfmTtKDh8/9bArJGPyqBhFHc1uEYxkr6JF4Xj3341lGazqkSVVty+SSXvx0GPmdqJuzZ6OWPlc79L41nyeuIw3BPkJE5bbrmFrRf+hOh3K/17jlkIL3nx/+Muyely1rKA5A+74weI1zQFEOJOlCwjyj0RoifRDvPZ/2rmUnmZNf8g20r07hjWQcyvXqEGJKIrW5pVYgQGIOHKb/AY5jaKqPQA0BkxeR5GUop8JVRPt7h83npSsK02ZpMc4bhQdOUf2EGbmUagnJvaM9ieXDYkxGC65KbT9Kdc/4BDEBGU6FSOFlaEvmKFypdaeakMwP5GE9LNKvGt9l1o5ZyQpxsnkJzkZivKM6yzM7OQzJGTZYWW9FjSHn+ZTFDGJ8uT/uq2NWhqVHyMvOAu6ofP5vffM9DwSCbOj+iXxfyLBTq7sR92zjJrAsZGofcJP/eJPrHEcbPNyBqGLYJYJdm/FZEkRE4nfoN82FOhu3SxTg8vXjAFkf3ujztPSNW0hO372YYesbfSNc8ss4bq/J1SRzdecyCyqdlEZyq6vp7q+ecr0gC7BNdfwD/Np9IZdQj4zn9gjySEvRAVOGlD930uIiM4sSVZ6cynZetrYo6prWbH2pf7jPuDNxxbV282B44T4MDJkujZyku+7qskuF+5hXYgtyJjOtGQ+5Vp9MUryj60+1cPShHnj8P0Y4mlnSzKs9jR7ipyZV3CiqAojOQVisQXED6QlQ3ydjTf+tlwovrPUMRt29BDNGEOQWTV0hdQVUD+6KtsfMaAPk7sAOAWtHUN7kKDOZsWnuS3lZ9yzu+RufbSpTqrGWhUxuFW7HotR05Gap02xM4wnUj/xQostZvtagyLoMcOOyFI6ulPsj/Ir/qkVeBZ2Qak9bpVyvBHA3Jcs5x/qzUErjuONZnguglpp8b/L2hcQ1tuDDSZA2R vKtpWgBN Fnj1L9lZAVBp46arnQdkwapO7DwVLKhKDpl9ELxK98LQz/0cxD8SDtHCj11QKUK7QdA/WBWnjq6Q22wqiYo47duBzMhX804OwCpxZuoYyLxgkZJ8HeANKFXDCxdpcg8OOSP1CeHgrfjyKl/E7yOqSEewGp8pbBb6ORyIoAN3t1LQnGQlxDhkI+p25KWOkXOI1k53pcopIxNxoLUiQLpgj39ibB5CQ1Of23+jsEf3rRWsBJbyQBR/JoGIhW83cx3cAPeI1kMYDU8V4ojM5fY6EGUXtuqI6Vo42eTKPuCXcI96cA6Xpcd8gUsi1WPz0Gq9j/w4VRMC1kgCbHaAWhsX2UsMQwbQdadkO0qrYNB9/+YW6O/7qAoVG6igbArWCq90fJGxfP8pgG1RMYLE= 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. It's unclear what are the userspace visible impacts of this change. Which makes it hard for others to determine whether -stable kernels should be patched. > Fixes: 7da4e2cb8b1f ("mm: thp: kill __transhuge_page_enabled()") > Reported-by: Saurabh Singh Sengar It's nice to include a Closes: link after a Reported-by:. Then readers are better able to answer the above question. > Signed-off-by: Zach O'Keefe > Cc: Yang Shi > Cc: Matthew Wilcox > Cc: David Hildenbrand