Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp579890rdb; Fri, 6 Oct 2023 11:57:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7NCeUCKQPpfjqsQ/C5AIJoRYBYdu1+ecxn7TaWRJbRvysRUm2ZFLT+yYCkGxWty7xLRE+ X-Received: by 2002:a17:902:a411:b0:1bc:4415:3c1 with SMTP id p17-20020a170902a41100b001bc441503c1mr6266375plq.7.1696618627649; Fri, 06 Oct 2023 11:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696618627; cv=none; d=google.com; s=arc-20160816; b=XF8gF/gW8qPxmkRX5zG06jhj0NuY03NJiWBkq3dWsGGFb1Segel/e4IrtavXGBkE/2 CygOrb9OSd3ll3THXALTiITI5xl+8buEkRCOHjTFDbKxPuacuF6f6xUiac+ahYqzvhTz 1JajzC+RFomkEOZchW+BQKY0exlFwlUDrEniYz2j9HRoHBWIFc83+IAnzc58OBe1Fmoy b9d+MgTfo1J7HjDBOct/cJQU5ImPYv3XguAHqFvgKWufQ/ACBNEEtBsBD3WIl6Iq53kU pBoBqx0tinrHVB5Bb94mLJyFLQh+bZ/fzM1N2p8XpXCF7Z8iGK9s82iShWlHahjUgtKB qbgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=UW50MvzyQoFy0Y9n7htqlvGtReQShELOcf6kg4n+7v4=; fh=sLA1uA/AfP8vliW2FnzxJnzjBrNl1oXPpbY5IZYfnfU=; b=GrKu56lNkbSHahxAwKszke/9UKPKuOF3vwOlyEQwoowyfNnqfNbIO2/MHj/3nYq8NL xypnJEXdnqPrixo6rWZgIH3nDCkRt9xkU564EP4zabxyFYPMLzYf4LZwLnr9waBFJYPL /p9WquADJayZi7lyW8PGJDhIhJPs2QohhC4COF9y87zdNFsTNMQP7s9PdDtFf3/TecN2 ad/c2I9ptXnFAQRY4fuPEG+89evrNnHPfTbgXTaaedAmWCWHHPWn65zLISnBrN5LvuDz CuPrGa8Qj5lw6eF3UNYu/w3DWteQ5bUY5+RBM1Vb46elSsNxUI2zC3MCqNzxToMLJGtM eQ4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gXDT58Hc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id y64-20020a638a43000000b00578bd92e502si4148029pgd.558.2023.10.06.11.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 11:57:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gXDT58Hc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C0AA880A4987; Fri, 6 Oct 2023 11:56:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233525AbjJFS4H (ORCPT + 99 others); Fri, 6 Oct 2023 14:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233534AbjJFSzh (ORCPT ); Fri, 6 Oct 2023 14:55:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF0391AB for ; Fri, 6 Oct 2023 11:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696618418; h=from:from: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; bh=UW50MvzyQoFy0Y9n7htqlvGtReQShELOcf6kg4n+7v4=; b=gXDT58Hc3fMlYZqxCwWmVXjh8ZKuSQkS0gPogfBAWBBj80i0a4vKqrl8OpXLTP0bNQ26E2 z177Dx5ZPUsqItVgE/k0cIPP7q81+LUVjWa5atJZiD1SI2uIklq1ZAu73TYoJim6HlJZ2z dGUFnqlnAkc4edVv/gxPm7ZnUwJqg54= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-298-wvQdhD0ON6asu949UZXTRA-1; Fri, 06 Oct 2023 14:53:37 -0400 X-MC-Unique: wvQdhD0ON6asu949UZXTRA-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-32686c75f8fso1786249f8f.0 for ; Fri, 06 Oct 2023 11:53:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696618415; x=1697223215; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UW50MvzyQoFy0Y9n7htqlvGtReQShELOcf6kg4n+7v4=; b=aKIrwf1G0FimxvJicouMMDYTF3/lIdj/rp1DZSz+fCqqHtFV2wGIA+DbSpCyR31BoG qJZCQK+bo6OMzMrPpZXEgml+snyuQyD3gRYXPUVszPYan3ef0E9yUvZ5t/ojPKe5sVtt 1P/1SL8gDSi2kSUbE5w9ER1hI9pgZhm0+VFrcR8vKHlyM4GE1EntUZE2TVcxG7RiEtGK oxlzMBmFJ3ts23+7BpANvukkNLphdVa/9i291F3C1d+jaDaNoSvfEF3ZG5RK+VYb6Nj8 HrTlP1lqc8H/toVKntRVOQVei86YHh06gvWm/UhnHFjNM53l+Qbi4C/iYCVHgOeMCfbX nw/g== X-Gm-Message-State: AOJu0Ywav/HyhQMnOuc4aGhKzKTeS6FTy6WtfmgKwq07/UZ3DADFChWR PbGLffFyLM21ZrulY2u+8fJriowpV7UmyCl/9srImJwT+yHCfjFokQdgMzaRtvdMlqTAEtD/rBw Or3c9qQrY+iVtR5UHA3EzEsNA X-Received: by 2002:adf:f692:0:b0:31f:e883:2ffc with SMTP id v18-20020adff692000000b0031fe8832ffcmr7401132wrp.43.1696618415038; Fri, 06 Oct 2023 11:53:35 -0700 (PDT) X-Received: by 2002:adf:f692:0:b0:31f:e883:2ffc with SMTP id v18-20020adff692000000b0031fe8832ffcmr7401116wrp.43.1696618414601; Fri, 06 Oct 2023 11:53:34 -0700 (PDT) Received: from [192.168.3.108] (p4ff23b7e.dip0.t-ipconnect.de. [79.242.59.126]) by smtp.gmail.com with ESMTPSA id g7-20020a5d5407000000b00327df8fcbd9sm2250805wrv.9.2023.10.06.11.53.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Oct 2023 11:53:34 -0700 (PDT) Message-ID: <225e8018-ef79-5514-a6ce-f5994206efe9@redhat.com> Date: Fri, 6 Oct 2023 20:53:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v4] mm/thp: fix "mm: thp: kill __transhuge_page_enabled()" Content-Language: en-US To: Zach O'Keefe , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Saurabh Singh Sengar , Yang Shi , Matthew Wilcox References: <20230925200110.1979606-1-zokeefe@google.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230925200110.1979606-1-zokeefe@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIMWL_WL_HIGH,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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 06 Oct 2023 11:56:27 -0700 (PDT) On 25.09.23 22:01, 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. > > Fixes: 7da4e2cb8b1f ("mm: thp: kill __transhuge_page_enabled()") > Reported-by: Saurabh Singh Sengar > Signed-off-by: Zach O'Keefe > Cc: Yang Shi > Cc: Matthew Wilcox > Cc: David Hildenbrand > --- > I've updated the changelog to reflect discussions in [1] -- leaving > ack to David / Matthew on whether to take the patch. Works for me. Acked-by: David Hildenbrand -- Cheers, David / dhildenb