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 4A05CC001B0 for ; Tue, 15 Aug 2023 17:27:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B9938D0011; Tue, 15 Aug 2023 13:27:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 743328D0001; Tue, 15 Aug 2023 13:27:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5BCD58D0011; Tue, 15 Aug 2023 13:27:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 43A8B8D0001 for ; Tue, 15 Aug 2023 13:27:34 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1BD7BA0B1E for ; Tue, 15 Aug 2023 17:27:34 +0000 (UTC) X-FDA: 81127020828.24.63EC7B9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf30.hostedemail.com (Postfix) with ESMTP id DD6B780002 for ; Tue, 15 Aug 2023 17:27:31 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=H6iO2qTZ; spf=pass (imf30.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692120451; 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=2uSl+ad9ZJrMAwLExJuewpBdrVGNDC/Z6BFlUzuDmqw=; b=VI20Klr7Lm/vFL71DeNHcvyEG5ogliEnyi0Vo+Kbua3egwn8C6y5ikRiLRhMsV45rpn+PK 72rFU0O5UW8XCyQEyGKpolWTE6qmgd1uCpHw227EikTT2I5wS4gLfFrjVT7eP6exUizaYV VvcZ7DiOgmiXRXJiPJpLx5gn29l9WvE= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=H6iO2qTZ; spf=pass (imf30.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692120451; a=rsa-sha256; cv=none; b=qqs+pt1sohvdmyuQbZOhJbtmNEpE2kPd4uXH0W/EVujN66qNjvwH/EE3MIhmqymCk7QWB0 kPUa3dqJhZFgck0TDyibXjO0B/w3GxZg+sT0nUQ0P+9+evaj/VNnj5aQwcyxGyErl40kF3 JtRGfVF2PVP50ctAZmm5zgEIdOPPPdo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692120450; 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=2uSl+ad9ZJrMAwLExJuewpBdrVGNDC/Z6BFlUzuDmqw=; b=H6iO2qTZmCt9SdL1hnb2O/GutT0wtAWMoc6ZJ9WZN3nQO5BYn14EwUJPE2epXo3EjFLHTD y/j46hBFJpd/1pv6ax/IH7PdkPJuEL39hHus6y3i0aND2WrMgTJN3IlHvMS3hyHS09Q2OM kegJrx4bxMzcdEdhl97qAQW6MPC/JjA= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339---dGtbpVO6KSNuzaDSTOZg-1; Tue, 15 Aug 2023 13:27:29 -0400 X-MC-Unique: --dGtbpVO6KSNuzaDSTOZg-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-30e3ee8a42eso3172094f8f.1 for ; Tue, 15 Aug 2023 10:27:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692120448; x=1692725248; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2uSl+ad9ZJrMAwLExJuewpBdrVGNDC/Z6BFlUzuDmqw=; b=UK3+ueUvHXu1GFCT8BSHj/3MGnLKZnDgHE1uxJzqfUvjBrUWFrcshm6MC93HMoZ2Ba 8VHfnSEJnEXcaPPx2Bn3KYMWBRS11SZdemvanVIIdI7U7ZcWccJFZUTO77MiYADdLels 2wnO7czmAxVV+0AtavvNemd9eG2eUXAZoAk/LH3M1b2f0H4rssgs4Ls+0BPLZGHIOEC+ EOAZ+GCM8KtOGxsp9aCkknxl6LqZaIj+CwnHjhgYExeRx7WMXJTQ7TaL34T4UcGL/OlM /YW5lrYpyduQowvoXYBho4fyWoPOREy3PGKWlPjztZtnnZAxQ9ALqXVleS8RKPQX3gTd QWnQ== X-Gm-Message-State: AOJu0Yyh5RXWFhFygh8OxTJApmSrHtEXLdR4mw7GQKuKK/LYWGNDF0wW hMTLs9SPBKBMtXsLu23bF22Br+m55mdfT6BwHkyDe5jmXwfHdt3XjLUGhFKhkLO0z9Z6fc59OGX rm5B05eydhtU= X-Received: by 2002:adf:efc2:0:b0:314:370f:e92c with SMTP id i2-20020adfefc2000000b00314370fe92cmr10407122wrp.67.1692120447930; Tue, 15 Aug 2023 10:27:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFHpJTpEtdHaORHl3IBepG/4Q1QmmaT6Ir71bM+CX9L0QpUJUTo+h1XxGn9yYs2bQkHm5Mvw== X-Received: by 2002:adf:efc2:0:b0:314:370f:e92c with SMTP id i2-20020adfefc2000000b00314370fe92cmr10407096wrp.67.1692120447566; Tue, 15 Aug 2023 10:27:27 -0700 (PDT) Received: from ?IPV6:2003:cb:c701:3100:c642:ba83:8c37:b0e? (p200300cbc7013100c642ba838c370b0e.dip0.t-ipconnect.de. [2003:cb:c701:3100:c642:ba83:8c37:b0e]) by smtp.gmail.com with ESMTPSA id i7-20020a5d5587000000b00314172ba213sm18569627wrv.108.2023.08.15.10.27.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Aug 2023 10:27:26 -0700 (PDT) Message-ID: Date: Tue, 15 Aug 2023 19:27:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: Matthew Wilcox Cc: Andrew Morton , Jens Axboe , io-uring@vger.kernel.org, linux-mm@kvack.org References: <20230815032645.1393700-1-willy@infradead.org> <20230815032645.1393700-8-willy@infradead.org> <7c1bb01d-620c-ca97-c4a2-2bb7c126c687@redhat.com> <88bdc3d2-56e4-4c09-77fe-74fb4c116893@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH 7/9] mm: Add deferred_list page flag 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: 7bit X-Rspamd-Queue-Id: DD6B780002 X-Rspam-User: X-Stat-Signature: znbibuptfno4dtjst5s36f33qxrigfuk X-Rspamd-Server: rspam01 X-HE-Tag: 1692120451-254097 X-HE-Meta: U2FsdGVkX19PdbMjOrqarY/ndS3OrTpPJ59KWajSCO93qL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We5mmpz4MrhSG52xnjEUq7i5KNJa42M88FKhmhPYUyIvmmtnpqdxbB4EPlfCoH7FxR74W2gsUCFEYQN41Ny7xILZrn3n6xPmwjoc45uEWC9bmtxVyDif2TJImvwyEcCWzSwRAO/Na9qOximCPUOavWmyaluoT3NGbhqOCaUuTcIDxXIiNNSD7v2s0m1RZjd7VbQD6DwQtFUOypQXBRLHGkTJGYcpvgARR1/FOkKnvfVE7aDNOAtxaeLnRapZ2jqGm36ZREqJZXUJeIYRT0jx2R9/n1XdPG+Io1Uf2BEFYok0apyw5Ijstlh/zzXnH0mKX90s8t6Zo5AULMGRmAVupyPPYoT11U= 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 15.08.23 19:06, Matthew Wilcox wrote: > On Tue, Aug 15, 2023 at 06:40:55PM +0200, David Hildenbrand wrote: >> On 15.08.23 17:32, Matthew Wilcox wrote: >>> On Tue, Aug 15, 2023 at 09:54:36AM +0200, David Hildenbrand wrote: >>>> On 15.08.23 05:26, Matthew Wilcox (Oracle) wrote: >>>>> Stored in the first tail page's flags, this flag replaces the destructor. >>>>> That removes the last of the destructors, so remove all references to >>>>> folio_dtor and compound_dtor. >>>>> >>>>> Signed-off-by: Matthew Wilcox (Oracle) >>>>> --- >>>> >>>> [...] >>>> >>>>> + /* Has a deferred list (may be empty). First tail page. */ >>>>> + PG_deferred_list = PG_reclaim, >>>>> + >>>> >>>> If PG_deferred_list implies thp (and replaces the thp dtor), should we >>>> rather name this PG_thp or something along those lines? >>> >>> We're trying to use 'thp' to mean 'a folio which is pmd mappable', >>> so I'd rather not call it that. >> >> There is no conclusion on that. > > Theree are a lot of counters called THP and TransHuge and other variants > which are exposed to userspace, and the (user) assumption is that this counts > PMD-sized folios. If you grep around for folio_test_pmd_mappable(), > you'll find them. If we have folio_test_thp(), people will write: > > if (folio_test_thp(folio)) > __mod_lruvec_state(lruvec, NR_SHMEM_THPS, nr); > > instead of using folio_test_pmd_mappable(). > So if we *really* don't want to use THP to express that we have a page, then let's see what these pages are: * can be mapped to user space * are transparent to most MM-related systemcalls by (un) mapping them in system page size (PTEs) That we can split these pages (not PTE-map, but convert from large folio to small folios) is one characteristic, but IMHO not the main one (and maybe not even required at all!). Maybe we can come up with a better term for "THP, but not necessarily PMD-sized". "Large folio" is IMHO bad. A hugetlb page is a large folio and not all large folios can be mapped to user space. "Transparent large folios" ? Better IMHO. >> After all, the deferred split queue is just an implementation detail, and it >> happens to live in tailpage 2, no? >> >> Once we would end up initializing something else in prep_transhuge_page(), >> it would turn out pretty confusing if that is called folio_remove_deferred() >> ... > > Perhaps the key difference between normal compound pages and file/anon > compound pages is that the latter are splittable? So we can name all > of this: > > folio_init_splittable() > folio_test_splittable() > folio_fini_splittable() > > Maybe that's still too close to an implementation detail, but it's at > least talking about _a_ characteristic of the folio, even if it's not > the _only_ characteristic of the folio. Maybe folio_init_transparent() ... avoiding the "huge" part of it. Very open for alternatives. As expressed in other context, we really should figure this out soon. -- Cheers, David / dhildenb