Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp546880rdb; Fri, 6 Oct 2023 10:50:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLWdwlW5XaF/zzIAU+bvYDJr2g+jO2OAf9PjGPSHnC6jkzQM6j7Z3sH/wzDAzMfjK6tQjL X-Received: by 2002:a17:90b:38d2:b0:26d:fcd:89b3 with SMTP id nn18-20020a17090b38d200b0026d0fcd89b3mr9001026pjb.8.1696614630375; Fri, 06 Oct 2023 10:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696614630; cv=none; d=google.com; s=arc-20160816; b=Naj9XcECVsnTXKTNivJD2i04oX6txnRwbTHL4fhEUplu7LuORJdoQ7zobjkwskytuO abUN4KTnnJ2N9kRPMe6dRkMa/LmGqqNtv0Hu3fOruIzhaPm7p0tGf3mr+4zYqL7l65qw oepM67GUEdIS0wK/HM2VGxVNOoBsWq8CN/TxnzmufTw42/iIhkipWNVn07L+3tfOfNVT RjPHKoH+5TGszjAXEnUVg1D3GioPUIIg8/T3ULnQIkq5IPAvgT/0WfD/1jzSxSXDPvxW CYAPY0zx3NCIk7+GJPR9Pae+vBroXrb7DlpP3WTQWawXTn5x1Dznb2Ni/dlvWUiiRqrm rxzg== 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=bxlZ09x94ak6N7YKNqDts0QfjjwSKqroa5h5VtkR3jU=; fh=od1vIefmnDDgyzz1md11c7jkg2JUzLI3UXeEDtAM0ck=; b=Etk2A+PHhhHFunNl/hcqRxugvoHOkqaXzG3NWkn3EiL4Gw26MuHhED1RFciJl5hcKq wAxsA+I6N6JytAs5KtZt3yzRWyohzGIjvkhiimp4G4MHqDgsB4WhiMeRsTCXFu8S3L4T 29VDKP8g+lkVwqQYkEp1vY/qnVAZrmT5mVGtZCXKt7MR9azM1QKU2LSnBZ2SG8uegp5Y p2FidVo8euykchQRGMgK4iyQs6WC2WYqkYfwKdotwO5PrIUgSDIGD8ymxkaSMSnCAB9m 4/vHoawDirLiWwDM/up2oOmKk4TH0/dsPnGXq1JZJ/z58cCr6+Q80J76ZIiKKVwHkRdW Csjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=sD7RhdIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id w11-20020a17090abc0b00b00278f79e4fabsi6217648pjr.93.2023.10.06.10.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 10:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=sD7RhdIt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id E04CB818B82E; Fri, 6 Oct 2023 10:50:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233005AbjJFRuU (ORCPT + 99 others); Fri, 6 Oct 2023 13:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232552AbjJFRuT (ORCPT ); Fri, 6 Oct 2023 13:50:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBD7FB6 for ; Fri, 6 Oct 2023 10:50:17 -0700 (PDT) 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-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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 06 Oct 2023 10:50:28 -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. 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