From: Zi Yan Subject: Re: [PATCH v2 5/7] mm: thp: split huge page to any lower order pages. Date: Tue, 08 Aug 2023 10:45:34 -0400 Message-ID: References: <20230329011712.3242298-1-zi.yan@sent.com> <20230329011712.3242298-6-zi.yan@sent.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_B9F89779-6ED9-4666-9B7F-FF6FF172146B_="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7guSE/On/Af6MDAkEypPOZndSAV8AV2RCD5K0lnYs+Y=; b=SjHt1r0MOAszMQxKSR5S+6l3VUa1SsTkCi8DGmf1ZDuWdlpI/cK8U6dlhxsQmLRIwUBv+eoTQOb+br2b7c9/Kw5aJ+y0g/YCB3LQz5LmwHu2jCdaOfH5uNPXxhQQgv57Y7i5IMFzEKQPpyfv5+bjP7wyASxuiiqP7+qrPsOHPIYO3lqPy+/F3obb80ns/ZX7cerpSOrJwcayDhtjGKcuIu/2NrEHgmCRchFr1HgRey7wiWrd/Y8oWnD9cxyC8kA1Bo/n9H+jDyhsY/HjRIM0fPz/p0I0yDEksmsh2Dws4iLozDLdh6K/6RKp4b/UVdxlHeFrJ9NrimyihAMP0YbTAQ== In-Reply-To: List-ID: To: David Hildenbrand Cc: "Matthew Wilcox (Oracle)" , Yang Shi , Yu Zhao , linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, "Kirill A . Shutemov" , Ryan Roberts , =?utf-8?q?Michal_Koutn=C3=BD?= , Roman Gushchin , Zach O'Keefe , Andrew Morton , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org --=_MailMate_B9F89779-6ED9-4666-9B7F-FF6FF172146B_= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 8 Aug 2023, at 5:01, David Hildenbrand wrote: > On 29.03.23 03:17, Zi Yan wrote: >> From: Zi Yan >> >> To split a THP to any lower order pages, we need to reform THPs on >> subpages at given order and add page refcount based on the new page >> order. Also we need to reinitialize page_deferred_list after removing >> the page from the split_queue, otherwise a subsequent split will see >> list corruption when checking the page_deferred_list again. >> >> It has many uses, like minimizing the number of pages after >> truncating a huge pagecache page. For anonymous THPs, we can only spli= t >> them to order-0 like before until we add support for any size anonymou= s >> THPs. >> > > Because I'm currently looking into something that would also not be com= patible with order-1 for now: > > You should make it clear that order-1 is not supported, like: > > "mm: thp: split huge page to any lower order pages (except order 1)" > > And clarify in the subject why that is the case. Sure. I will add below to the commit message and the comment of split_huge_page_to_list_to_order(): Order-1 folio is not supported because _deferred_list, which is used by partially mapped folios, is stored in subpage 2 and an order-1 folio only= has subpage 0 and 1. --=_MailMate_B9F89779-6ED9-4666-9B7F-FF6FF172146B_=--