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 D62CDC3DA6F for ; Thu, 24 Aug 2023 14:05:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35AF32800AF; Thu, 24 Aug 2023 10:05:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30A8B2800AB; Thu, 24 Aug 2023 10:05:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 184152800AF; Thu, 24 Aug 2023 10:05:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 03C6B2800AB for ; Thu, 24 Aug 2023 10:05:43 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 972A1C0380 for ; Thu, 24 Aug 2023 14:05:42 +0000 (UTC) X-FDA: 81159171324.22.B48BD45 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id E7A8A4001B for ; Thu, 24 Aug 2023 14:05:39 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="a/q0qDcF"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692885940; 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=/kdlyY1rxLStA0sZIf31nmHBWQd408u/RI4yuAsVY9M=; b=fHF3g+3dmS7uZHtFDEP2sB32Sol75PGbvkc5O4xddu0pJ40SdoyC/aADzMZDUhh4iI28qE HiKIjnLJVv2ZzCY6TZTZ30SOf7JYumOG41OCGTEPPITIAL5gfVDFYylSFEEnCY4cIyD+vE bGi5F2vDnVuqaHQ07RtDN685WSKyisw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="a/q0qDcF"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692885940; a=rsa-sha256; cv=none; b=DeJ8PtqM3OWXWfS/k95kYXEzBl0OP4BwF39pxJaShsA43gQXmve6PfY7/AGDu6SaaC/L9A A44npETURF1yAs4OylM7QmuaZsETeIYXF2iJi3Go1Fioha9zB06xiT4HZFmEsLC9zZde88 +7GqZ/afpuPhTUbGA8zp9XTKj81/tcs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692885939; 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=/kdlyY1rxLStA0sZIf31nmHBWQd408u/RI4yuAsVY9M=; b=a/q0qDcF2I4mc4xDsKi4c8kPJ+s+IbHAZjgivyeU3cM4xae9FdnFWrozmUFh6mom1P9m9I JU2Xf0U3zPkkIqFMAB83vlEgywghbvc8+6BpZYUadGTByyt83KNBUM/Tn92x8g6pgpwKzh x8MoRisLZrEJtUA54QNQq0vB/3Ji4LU= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-112-pCzyARHjOFOUwQEyAn9UHA-1; Thu, 24 Aug 2023 10:05:37 -0400 X-MC-Unique: pCzyARHjOFOUwQEyAn9UHA-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3fd0fa4d08cso47090315e9.1 for ; Thu, 24 Aug 2023 07:05:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692885933; x=1693490733; 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=/kdlyY1rxLStA0sZIf31nmHBWQd408u/RI4yuAsVY9M=; b=fT4IKvLkfIhkvXaW9OtaMJZDH9CtLaYp49w3Z2djbVTDi4qSxgTsf9RxLFxqVNPbS5 6wW6SpvOGW45yj8Jlu5OYKUqzoraJVEyfUg73QT4sgX3zGR/gMx+jugNd91QlvKIvDkr GKAwyuJf66gD+H0vlhfsjq1/79wxRydV1QWxpYoGEbkbIsNItCe5w6Ji9wcNyrZmLLsm s4sBPTkciBfAByWC8wH3mj7OgqnRBQrfXzhwPRk/iTbzOn0SteRs8N0LbSttgvp8df4G TrFnRkgMjfkTai5O/It0xt00LU26GvwpfmcbTv0m6H/RQ/lxOsF0hO9EC++Kf+LBJIzT 6JwA== X-Gm-Message-State: AOJu0YzKJEi/h6BH26NkFjhz5b+xXBc8w2JbqF5vLHOs5+dPD7pXyzaw S9OYFrFCHbYMyccYkIDDQIK8qG0mL0YINAPLg/n1gu4EYfh8J3HvinYh5FpKu5O7uS2V7WpFVnw xtnbQD/AAUIo= X-Received: by 2002:a1c:7303:0:b0:3fa:8db4:91ec with SMTP id d3-20020a1c7303000000b003fa8db491ecmr11345477wmb.10.1692885933595; Thu, 24 Aug 2023 07:05:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH01Vq2LWrop3ypAQ3hCvb48NoDnpC9x+5DOwowE3VE9xlmzqmQzGCt57dBR6Fg9yGpp96bAA== X-Received: by 2002:a1c:7303:0:b0:3fa:8db4:91ec with SMTP id d3-20020a1c7303000000b003fa8db491ecmr11345446wmb.10.1692885933092; Thu, 24 Aug 2023 07:05:33 -0700 (PDT) Received: from ?IPV6:2003:cb:c709:6200:16ba:af70:999d:6a1a? (p200300cbc709620016baaf70999d6a1a.dip0.t-ipconnect.de. [2003:cb:c709:6200:16ba:af70:999d:6a1a]) by smtp.gmail.com with ESMTPSA id k16-20020a7bc410000000b003fee849df23sm2744831wmi.22.2023.08.24.07.05.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Aug 2023 07:05:32 -0700 (PDT) Message-ID: <3e08d48b-7b70-cc7f-0ec1-12ad9b1a33db@redhat.com> Date: Thu, 24 Aug 2023 16:05:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3] mm/thp: fix "mm: thp: kill __transhuge_page_enabled()" To: Zach O'Keefe Cc: linux-mm@kvack.org, Yang Shi , linux-kernel@vger.kernel.org, Saurabh Singh Sengar , Greg KH References: <20230821234844.699818-1-zokeefe@google.com> <37c2b525-5c2c-d400-552c-9ccb91f4d7bf@redhat.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E7A8A4001B X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: qbe5yrz1g7stir5813emfcp8is5hspup X-HE-Tag: 1692885939-981937 X-HE-Meta: U2FsdGVkX19CW4KUIATurGONASxI6hrr4aDXatXsRCKDAdVZquPyxcDopaL+D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B0uojFa40L10sENFvLcVvf0teXZko+PMyf9cCcVMbzUmlIhJDks3EbFzddQPpXR9I2451V6UxMBoZagWhtTnbYO72kdu0o4owPSmIvDlYXLDZ/789+i3yK+RQo3afX5TUS85qAFAgwEO3mSuUyAFiAFQuR7YCagNfnhBzhjS3Sh0VWzwfvan1XQJsedD4Ei0empVILn4cjnni+2kXeLxC7dLME= 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 24.08.23 15:59, Zach O'Keefe wrote: > On Thu, Aug 24, 2023 at 12:39 AM David Hildenbrand wrote: >> >> On 22.08.23 01:48, 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, there is at least >>> one occurrence where an out-of-tree driver that used >>> VM_HUGEPAGE|VM_MIXEDMAP with a vm_ops->huge_fault handler, was broken. >> >> ... so all we did is break an arbitrary out-of-tree driver? Sorry to >> say, but why should we care? >> >> Is there any in-tree code affected and needs a "Fixes:" ? > > The in-tree code was taken care of during the rework .. but I didn't > know about the possibility of a driver hooking in here. And that's the problem of the driver, no? It's not the job of the kernel developers to be aware of each out-of-tree driver to not accidentally break something in there. > > I don't know what the normal policy / stance here is, but I figured > the change was simple enough that it was worth helping out. If you decide to be out-of-tree, then you have be prepared to only support tested kernels and fix your driver when something changes upstream -- like upstream developers would do for you when it would be in-tree. So why can't the out-of-tree driver be fixed, similarly to how we would have fixed it if it would be in-tree? -- Cheers, David / dhildenb