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 2F354C433EF for ; Wed, 13 Apr 2022 12:28:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E6336B0072; Wed, 13 Apr 2022 08:28:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 795976B0073; Wed, 13 Apr 2022 08:28:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 65D046B0074; Wed, 13 Apr 2022 08:28:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 584036B0072 for ; Wed, 13 Apr 2022 08:28:44 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 2AE5961127 for ; Wed, 13 Apr 2022 12:28:44 +0000 (UTC) X-FDA: 79351784568.14.0EA462E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf31.hostedemail.com (Postfix) with ESMTP id A8D282000B for ; Wed, 13 Apr 2022 12:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649852923; 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=qsU6DS5U2wkJ+v5NrpLhGhWiJHM31d3LlhPBq0tETIc=; b=WI8MS9lbFyuD4ykqzV028RJ+Fo5boIGtxxsLP7p2kwtT6Akzf/JKiAMyGSsKOa84QcJSv8 FmcQfuLpm/RW/JCsWIYpluqZcFJEshn48kwczev54YKa6yLnBpCm8dRsH7of+l4pG30mMc CBkVSFcVrv15ej9VrZSay7npj+EhQOM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-353-i_qn_tJ-ObKleclx1WSzXw-1; Wed, 13 Apr 2022 08:28:42 -0400 X-MC-Unique: i_qn_tJ-ObKleclx1WSzXw-1 Received: by mail-wm1-f72.google.com with SMTP id q6-20020a1cf306000000b0038c5726365aso750098wmq.3 for ; Wed, 13 Apr 2022 05:28:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=qsU6DS5U2wkJ+v5NrpLhGhWiJHM31d3LlhPBq0tETIc=; b=NsxVGkcoWuMcL92wa+iluC6EMzRRQriCkbCjvMv4BTbXJ/ICmktLf3v1iCAg6It/YU ue9zckuFnuqSMWmFvQvnRTQlry286TWIDQvGxSgtBMyNs51tAsAsC0CGULclB0KNKJ/o +AxRm3KMPXBjMAxaAR36AwFw7Vdd8c5dArNf3i0zVR1eiLNb53vsnZpLg8X/9VhF83M7 ev6dWWrAYwFCdHyEZXyzJ4pskf3ygBl3IxuNL05BEk8fFt1jaD/9zgSczokzVwwZfe1y O5wW8z360gRr5dGbhzyjblpl/otV2W3IhjJYXawC/6a//5j5fOmV6OY9oUqq/X9l2lcy eiWw== X-Gm-Message-State: AOAM533s8Ba98m58jpuOq87GxUi5IAPakw0uP1Sqcx+QC76lTb92CC/y KbF7L1W9EKxhwndcR41SM+l+364kQtwkJ3G+GHtcqRTFC/PVn3ZCWzLtqjfoHatJkMh9Kc6Sbry ZG3eSTAQnrms= X-Received: by 2002:adf:e74a:0:b0:1f0:25cb:3ad5 with SMTP id c10-20020adfe74a000000b001f025cb3ad5mr32825356wrn.231.1649852920938; Wed, 13 Apr 2022 05:28:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBPuGiBkWKAv4X+Gv+AZ8tuTHo5epBTh7Wu31/gbzLstA9OS8Bqszv+EEp4CdiHPVziWNY7g== X-Received: by 2002:adf:e74a:0:b0:1f0:25cb:3ad5 with SMTP id c10-20020adfe74a000000b001f025cb3ad5mr32825329wrn.231.1649852920699; Wed, 13 Apr 2022 05:28:40 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:5800:1078:ebb9:e2c3:ea8c? (p200300cbc70458001078ebb9e2c3ea8c.dip0.t-ipconnect.de. [2003:cb:c704:5800:1078:ebb9:e2c3:ea8c]) by smtp.gmail.com with ESMTPSA id r12-20020a5d6c6c000000b00203ec2b1255sm39631983wrz.60.2022.04.13.05.28.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Apr 2022 05:28:40 -0700 (PDT) Message-ID: <0c9d2c39-5080-a855-8ecd-e2c1bd1179fa@redhat.com> Date: Wed, 13 Apr 2022 14:28:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH v3 08/16] mm/rmap: drop "compound" parameter from page_add_new_anon_rmap() To: Matthew Wilcox Cc: Vlastimil Babka , linux-kernel@vger.kernel.org, Andrew Morton , Hugh Dickins , Linus Torvalds , David Rientjes , Shakeel Butt , John Hubbard , Jason Gunthorpe , Mike Kravetz , Mike Rapoport , Yang Shi , "Kirill A . Shutemov" , Jann Horn , Michal Hocko , Nadav Amit , Rik van Riel , Roman Gushchin , Andrea Arcangeli , Peter Xu , Donald Dutile , Christoph Hellwig , Oleg Nesterov , Jan Kara , Liang Zhang , Pedro Gomes , Oded Gabbay , linux-mm@kvack.org References: <20220329160440.193848-1-david@redhat.com> <20220329160440.193848-9-david@redhat.com> <4cb92b41-95e1-1666-321e-96ff9e6095bb@suse.cz> <368902ab-8d3f-5d62-581e-1ff930bcefa0@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 Content-Transfer-Encoding: 7bit X-Stat-Signature: cogthfmjzh4691oosmiwwp6znwspuhm4 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A8D282000B Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WI8MS9lb; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf31.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com X-Rspam-User: X-HE-Tag: 1649852923-895168 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 13.04.22 14:26, Matthew Wilcox wrote: > On Tue, Apr 12, 2022 at 11:37:09AM +0200, David Hildenbrand wrote: >> On 12.04.22 10:47, Vlastimil Babka wrote: >>> There's a VM_BUG_ON_PAGE(PageTransCompound(page), page); later in a >>> !compound branch. Since compound is now determined by the same check, could >>> be deleted. >> >> Yes, eventually we could get rid of both VM_BUG_ON_PAGE() on both >> branches and add a single VM_BUG_ON_PAGE(PageTail(page), page) check on >> the compound branch. (we could also make sure that we're not given a >> hugetlb page) > > As a rule of thumb, if you find yourself wanting to add > VM_BUG_ON_PAGE(PageTail(page), page), you probably want to change the > interface to take a folio. Yeah, I had the same in mind. Might be a reasonable addon on top -- although it would stick out in the rmap code a bit because most functions deal with both, folios and subpages. -- Thanks, David / dhildenb