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 6F570C0015E for ; Tue, 15 Aug 2023 17:06:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA1798D0011; Tue, 15 Aug 2023 13:06:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B52228D0001; Tue, 15 Aug 2023 13:06:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CB838D0011; Tue, 15 Aug 2023 13:06:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8BAB48D0001 for ; Tue, 15 Aug 2023 13:06:44 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5E704C01C6 for ; Tue, 15 Aug 2023 17:06:44 +0000 (UTC) X-FDA: 81126968328.28.5FA46BE Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf28.hostedemail.com (Postfix) with ESMTP id 6AFCAC0032 for ; Tue, 15 Aug 2023 17:06:41 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="ay03J/B2"; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692119202; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vZqPRg3r0m5C1a2IsUiQeDDBtBFofgrb7BHNPuc4+8E=; b=1OP+yeJfli8OAPXYKR/bBX1Vyv7/BXVvVxXlHABuC4BRixHVYFTBE6vbXwrsvAJDOoXOTz wre6rjvCLALPKxWL4b2UfRr9PfBZquf2Phr/FjkZyTL+uqvuPMSAph8YIBGN2f5lu6hTTM ZivK1Qqz+YIFzabbWPrI0+i0QNfi+kU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692119202; a=rsa-sha256; cv=none; b=DTb98+43YFfmc9u0N9MaTF5l7LyPn0YhtlB/vAbszzOJCV6aVF4tOIrlvGn7Vc20hlXCAi 3kfhjBwaQx2RsFV3fO+s+ffRNjdaB7QHdnN3VyMXnuAI3rAOaYl92kK4klgUruQUmQHX+8 akXXolL2/ZXEfzW3yTyKHpEMNqzqJK4= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="ay03J/B2"; spf=none (imf28.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vZqPRg3r0m5C1a2IsUiQeDDBtBFofgrb7BHNPuc4+8E=; b=ay03J/B2Fx0p2iGHY4Nyfg/Hor wUdxyG7UOgsk+vljXcadenka3BHlsnb604xTvvd6KRflAKI9gSLVa8PsnsnN6s93eFiOMXSGLrZrw 40yCOprE0w7Yuqsfz4AFsPpFgELv/GyTPDERzv/ZmCE8B4oRyb4m/9vYsoXiEVbKRvWExkfyIKUnT jzrRIyQc5IyBfVrmws2/TdMLcqJys9tfXhPrqIloqHiHfDg5iKJcqDnBia/FzxulTDKEVkaT6oFwR hIKccArwWkdefAJN6FzWXCZz32ll1MMwxR8OxprNfb4sZNOTZTlvoHMdnYjRodPcd1+2Tzpu1PMIY z9lNvBHw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qVxV5-009O6Q-Sn; Tue, 15 Aug 2023 17:06:35 +0000 Date: Tue, 15 Aug 2023 18:06:35 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Andrew Morton , Jens Axboe , io-uring@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 7/9] mm: Add deferred_list page flag Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88bdc3d2-56e4-4c09-77fe-74fb4c116893@redhat.com> X-Rspamd-Queue-Id: 6AFCAC0032 X-Rspam-User: X-Stat-Signature: 1gt4f1jbdtsfgdbjb8di75b8jt1gn4ts X-Rspamd-Server: rspam03 X-HE-Tag: 1692119201-243406 X-HE-Meta: U2FsdGVkX18aZlYcQuPjnwiGKDpDHnORHYr+fT85LgjBhdDAUnMTTc/cYsVdsfLw5W65+JYD+R5/547U5WO77TXtWKM/nGUx+KSVEIYxEWSRkqbjyhthy8TkDdFpNtWhAMZ0feHpbATPeeAj6YN8nVjnLvnG1rMW8aHyGAjWdrTby5LCWKKKd50yp+1oZTb3KoKyUxHBxFFC9mF5GbitzvsVDfh7eWKO4O0pTBhNcP1TWdFnLdG1f+3Ws+VyKUgnpLQB/F1l5oueOvJ4lkUjh/bPxxaSrYj0jXXkW7zJ5LPNT64i7lscLN4OdooD9vq8VJZk1bq2Sw92pSvJ3bUswuskgAEw/KcSLDKM2RshiEi/RmCh8qJcQzbeBBT/Hte/Opg3D3eaUakvy2j8wB91y0iG3zmKJSrAPc+DUq0hZVRlDF/ABHnKNMg2mnnIATl60IW5up3/XdfUW7cfr5oLBXARTZrELkhWCDs0kL6zUovgPPM1rnANvXRSwBtixmMhPsQOKUHS9VGR2h1bgdJaV28TGiVOA00tc4B97rNIEK7O09wx/GAb+e1geT7Y+qTgpU6SUia+3CLF6noieoO/eXHThsNT56GDHbS2KlcBMWO+g1Jeg2DKVU7s9fVD6LTJvk/DUd37Dz4gbtpFKQsmz0Zk2Cr9GCfzzvgjpju0M1rx/+esqGJwluow9PwxSuqJAg4V563CUvEZF+QKM1gD1akDatk0yFZY1qj0ZTGcmusvRmLlWzbB/cV5H3+g3D8c7JHyx+KfiREl45wRTCpcANSrRysEgnEbt+7NNtu4mTDwBbr4iUY8kw/75oUyJqiynG7Zh86oddffikZuG6Mp87o6Yl5EfZjheNxVA2ybZ2KbWj919JnuB3Ytm613Q6xPxgtdG7wb/0sYRNcGl8WJPQyv7AWHTT/o1KajVDWvTmgUyX6Nk0crj+cd4gydRxhcfyl/a0oUV8U1pUUbcbK 39nD/yNY 3ZaxlSA8tS5XmOjpvnkGd0N51XmrofEIJVBR2OGM0W/PMHGZXZ3ubcNCBZr2xVSwji/CkuebE+S+TmNb3pTK0wmCfkrFI9HFdCwBjc4vXqnHE52hnsIIhXaDq0Dnaytc3S6ybyEivMlcdwJP7r2kI+mt53p71aX4jaDacQ4RCKYRVooLU3TweIZ8RODB1xirnkGlSKbWqnEkDkpifwIEqGpJ9f/TxGY5R1HLD+NlT9plMzcc= 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 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(). > 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.