From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCFC63E4C6C for ; Wed, 13 May 2026 08:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778661973; cv=none; b=TByUswrLYxMAOL0aX5B0ImpF7pjopyauiebWw7AC8mscG7Eu63ihsHS9bVtdQy/tawXGiJZUp7YsA1D2lumAjqXw/RYugtFUGrf80NMggxleqlVzbeaJ5wl/A9afK7q3vPxUl/Pqn2nt5SoGh4ClEILAWBK/ScjlSlorfsv367w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778661973; c=relaxed/simple; bh=ILWBwGm83K3BmLSOpvLrUBlj85UBNl86Bqkemg2OxXA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uRygSzXYmci7dPndXWij7JzMaWSMgHUSy1zmGB+lqRFyYWvZnXkpO1hd1dI+fO56H98wdGpcx7it41Izgcw2Cv5w1a/qAFRb6uBe/9qLfmDrEFPEjZ7/a+sR/skQ2FLhgDBU7ACjeR4C64e5JMPMeh3MYO1ADHhes6gc51PefUU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DRJceDL9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DRJceDL9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06085C2BCC6; Wed, 13 May 2026 08:46:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778661973; bh=ILWBwGm83K3BmLSOpvLrUBlj85UBNl86Bqkemg2OxXA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=DRJceDL9vOKLM1mjkAiDRA6gLZQki+SibT/RXFX3rZjHTMno3DOy0cQ1s3lwUmxiu xA/VXkFXesot8egraTCH0yK27xHLHtinSgs3bmDeKv5dgVtFm1RNQaMoBN7WhX6WE2 orkf9gh2eR3LG9je8Hcuu4tuhSYoWQxa41psIv4jvpaUh6FZCLbrMYhkMWYs0jc5KE o1K+zkjdfDXO8nGvm69xRPMDyz88OfHPc+2Ya+u40U/fZZeqxmm16jD97mU5LkRfMm VsvnPdrdnEolhz8eSJRR3H/giVuIjOrB8iGZ+U/l4l4a++Ul9OJ8en8wplVle65sQ2 2B16qypcMVJVA== Message-ID: <995579f8-d099-4985-874b-ad8114936661@kernel.org> Date: Wed, 13 May 2026 10:46:06 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 16/22] mm/page_alloc: separate pcplists by freetype flags Content-Language: en-US To: Brendan Jackman , Borislav Petkov , Dave Hansen , Peter Zijlstra , Andrew Morton , David Hildenbrand , Wei Xu , Johannes Weiner , Zi Yan , Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, rppt@kernel.org, Sumit Garg , derkling@google.com, reijiw@google.com, Will Deacon , rientjes@google.com, patrick.roy@linux.dev, "Itazuri, Takahiro" , Andy Lutomirski , David Kaplan , Thomas Gleixner , Yosry Ahmed References: <20260320-page_alloc-unmapped-v2-0-28bf1bd54f41@google.com> <20260320-page_alloc-unmapped-v2-16-28bf1bd54f41@google.com> From: "Vlastimil Babka (SUSE)" In-Reply-To: <20260320-page_alloc-unmapped-v2-16-28bf1bd54f41@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/20/26 19:23, Brendan Jackman wrote: > The normal freelists are already separated by this flag, so now update > the pcplists accordingly. This follows the most "obvious" design where > __GFP_UNMAPPED is supported at arbitrary orders. > > If necessary, it would be possible to avoid the proliferation of > pcplists by restricting orders that can be allocated from them with this > FREETYPE_UNMAPPED. > > On the other hand, there's currently no usecase for movable/reclaimable > unmapped memory, and constraining the migratetype doesn't have any > tricky plumbing implications. So, take advantage of that and assume that > FREETYPE_UNMAPPED implies MIGRATE_UNMOVABLE. > > Overall, this just takes the existing space of pindices and tacks > another bank on the end. For !THP this is just 4 more lists, with THP > there is a single additional list for hugepages. > > Signed-off-by: Brendan Jackman Reviewed-by: Vlastimil Babka (SUSE) Nit: > --- > include/linux/mmzone.h | 11 ++++++++++- > mm/page_alloc.c | 44 +++++++++++++++++++++++++++++++++----------- > 2 files changed, 43 insertions(+), 12 deletions(-) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index af662e4912591..65efc08152b0c 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -778,8 +778,17 @@ enum zone_watermarks { > #else > #define NR_PCP_THP 0 > #endif > +/* > + * FREETYPE_UNMAPPED can currently only be used with MIGRATE_UNMOVABLE, no for so ^ > + * those there's no need to encode the migratetype in the pindex. > + */ > +#ifdef CONFIG_PAGE_ALLOC_UNMAPPED > +#define NR_UNMAPPED_PCP_LISTS (PAGE_ALLOC_COSTLY_ORDER + 1 + !!NR_PCP_THP) > +#else > +#define NR_UNMAPPED_PCP_LISTS 0 > +#endif > #define NR_LOWORDER_PCP_LISTS (MIGRATE_PCPTYPES * (PAGE_ALLOC_COSTLY_ORDER + 1)) > -#define NR_PCP_LISTS (NR_LOWORDER_PCP_LISTS + NR_PCP_THP) > +#define NR_PCP_LISTS (NR_LOWORDER_PCP_LISTS + NR_PCP_THP + NR_UNMAPPED_PCP_LISTS) > > /* > * Flags used in pcp->flags field. > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index f125eae790f73..53848312a0c21 100644