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 CC2D8EB64D9 for ; Fri, 7 Jul 2023 13:12:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21ABE8D0001; Fri, 7 Jul 2023 09:12:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CAAD6B0074; Fri, 7 Jul 2023 09:12:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 093268D0001; Fri, 7 Jul 2023 09:12:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EF2766B0072 for ; Fri, 7 Jul 2023 09:12:38 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C1F79120CD1 for ; Fri, 7 Jul 2023 13:12:38 +0000 (UTC) X-FDA: 80984855196.21.46034DB Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id EDC2EC0020 for ; Fri, 7 Jul 2023 13:12:35 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nAYdwiUT; spf=none (imf22.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=1688735556; 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=wFqH+7Ljt87dhV27Wcx4gWglYgjDuLdi+M0sLgvzXk4=; b=zedKt8vrZp69QdQo8R6zUu1iKChElVCpaZVW5qGPSMX98vykLNBsABxBqvPw+UhHZiLXev 5Xc2Cq5m2XABTsGosyoHJkLGYYfR3gyb7zfKxAUtgERV0FdUn+FN/X2hPEJ6iKypb8Rlt/ FkfAjpVFr3H+niW89FzkeLEa73Ps+hw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688735556; a=rsa-sha256; cv=none; b=ZJqst3QbUagfrZxlmJzU6RmE+ZCkIl7oDzEfVTX55FDi4pXJMqPRHyGYyATNqAxoFJkye7 qJNv1RSSD+goHwIGBE24HWOquJCLgJ+Cno09F+xMJtSvziGw+PhOpQAsoeGrMUToB4sIP/ ZWVrU0szt8yLzO0W3KwWJ1G3DcbkNRk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nAYdwiUT; spf=none (imf22.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=wFqH+7Ljt87dhV27Wcx4gWglYgjDuLdi+M0sLgvzXk4=; b=nAYdwiUTj5N+C2ndcrXIOg0NzR WgxCiFOP2iVzT08YnZ2DvkdKCcsuzkmwLFNZyNSRpRI8+WvxQlC9WBYmP44C+6AGeVqjql77XetW3 stIXD8X2JRK8P1VBm98RpEWHXhV5VosQB5Jmp/Bj24p5Q8HsLIWls2YhnQ/zaECn92lZGEYyzbMkV c7I7WPtCQ+QQGIQBT0bvqSTcGvjYXgSXSTcLMC+97NqXFtyneSoi+IKhdyvw0JkysOHYAYJPirPg5 Jy3ZsbWiifnqtPL+dfpsjtd0mPjbFoq53nlpAJeX/+dzpASGKox4pRSYzjifqPNyX5XiVQlcGhA+j MPL5FXAA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qHlFi-00C2ig-1Z; Fri, 07 Jul 2023 13:12:02 +0000 Date: Fri, 7 Jul 2023 14:12:01 +0100 From: Matthew Wilcox To: David Hildenbrand Cc: Ryan Roberts , Andrew Morton , "Kirill A. Shutemov" , Yin Fengwei , Yu Zhao , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 0/5] variable-order, large folios for anonymous memory Message-ID: References: <20230703135330.1865927-1-ryan.roberts@arm.com> <78159ed0-a233-9afb-712f-2df1a4858b22@redhat.com> <4d4c45a2-0037-71de-b182-f516fee07e67@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 8mrj3y7ipkgpqcysa1bw8bg55ig1rqmx X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: EDC2EC0020 X-Rspam-User: X-HE-Tag: 1688735555-993796 X-HE-Meta: U2FsdGVkX1/gd4PkeC6Wl8/RSORrK2nSt6gHfwgUVoUE6P3W0CehE6XjRdLOtBmNSK4o5/TW53HkdTNnlFEyJGHPamxi+4ulXW0D2qj5VehZYamiFX3RkiY846QEa/bYThQiTRiscHB62CtQQhtMruUDLauVbXbyW4hH9n3pNPc+x4rVnh1s14vcvG83j4hHwdXQdYYnoNnbiiww2nlu7Q42mxHGE1NiEbuA260WiCGYC9FYLOgQi5FkPKYfY5sWwyDyC8BT+2TaxW190zuo2sUzEBtBKYz+ByL0wx2HHJbpMY8gcSv7LZMnjlMMANbvibZLtZILDv16o6VjpGx9cTVI1w0yzoC03kCcxcCWeN+OUofxuAhom/ChOI4+pje3E+Bg1U2AmR2l7AaO54ZIX3Bj8+pinGdVrS7sGa5ZZhweDos4gFUCNJdhLTqrPJwGCFojodJbml+j+D2TTMtMSIHPbMR3/yIKP7gE9xc0RfSKohEqkYfbZTYRPFQQKoiXRPYzAWBlk2sg2SRiR0c5Hz8PqreQ9dEmy2GM4jBH89BgIS5xEa6Na4ukjKkhJKCnh5lMONL2oqdTmfU5fvnW0W4du/GRohbQ5RGyUiIQMXTkCPWFtSLZvGGHrqRXIo409emguaCXCUhpXZ6p7wrY4gu+JBq7qEfv332OnsWE90h6kWvwq2d9VHXaFPQBzn/NdB69FVXwRxmFSmxUjFq1uBuluy3DCSU/23YDjtjH65oXAt7eTwB//ZFSSx7ozL75Eaa19R6UcB/TrN/deVw4HcxyUJxILxmtBgLbszE/zTp94GC0t4/fqI6aY4Cg/4688FxP7YpWXftoaCLRBI5WrmABNFAnCri80Dea8Sr5SvWIBDHtnZZkVBoJvy8vxAwYTzJwjsTeP44x8BFeLVdteiSwHJbQYJhBqziC4TNrfOdpd5dger+/FQb1lXdbTJWxfLcFah//6hhRKi1yA4k Yvdlrwuo pKGNsSNk95gYs8TLX7hG4/czyqTYXwSliTnXqvyNmyfqtJzeex81wEDwAs+px+3RRsbTu6kxpldR3ZRcgjf91Dtd09Xpve/dVauqeneYWwcKq5CX3rvoj5w4YhHy4WLoA77+rZMkkk4sniN4= 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 Fri, Jul 07, 2023 at 01:40:53PM +0200, David Hildenbrand wrote: > On 06.07.23 10:02, Ryan Roberts wrote: > But can you comment on the page migration part (IOW did you try it already)? > > For example, memory hotunplug, CMA, MCE handling, compaction all rely on > page migration of something that was allocated using GFP_MOVABLE to actually > work. > > Compaction seems to skip any higher-order folios, but the question is if the > udnerlying migration itself works. > > If it already works: great! If not, this really has to be tackled early, > because otherwise we'll be breaking the GFP_MOVABLE semantics. I have looked at this a bit. _Migration_ should be fine. _Compaction_ is not. If you look at a function like folio_migrate_mapping(), it all seems appropriately folio-ised. There might be something in there that is slightly wrong, but that would just be a bug to fix, not a huge architectural problem. The problem comes in the callers of migrate_pages(). They pass a new_folio_t callback. alloc_migration_target() is the usual one passed and as far as I can tell is fine. I've seen no problems reported with it. compaction_alloc() is a disaster, and I don't know how to fix it. The compaction code has its own allocator which is populated with order-0 folios. How it populates that freelist is awful ... see split_map_pages() > Is swapping working as expected? zswap? Suboptimally. Swap will split folios in order to swap them. Somebody needs to fix that, but it should work.