* Re: [PATCH v5] mm/alloc_tag: replace fixed-size early PFN array with dynamic linked list
[not found] <20260506022256.32664-1-hao.ge@linux.dev>
@ 2026-05-09 0:12 ` Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-05-09 0:12 UTC (permalink / raw)
To: Hao Ge; +Cc: Suren Baghdasaryan, Kent Overstreet, linux-mm, linux-kernel
On Wed, 6 May 2026 10:22:56 +0800 Hao Ge <hao.ge@linux.dev> wrote:
> Pages allocated before page_ext is available have their codetag left
> uninitialized. Track these early PFNs and clear their codetag in
> clear_early_alloc_pfn_tag_refs() to avoid "alloc_tag was not set"
> warnings when they are freed later.
>
> Currently a fixed-size array of 8192 entries is used, with a warning if
> the limit is exceeded. However, the number of early allocations depends
> on the number of CPUs and can be larger than 8192.
>
> Replace the fixed-size array with a dynamically allocated linked list
> of pfn_pool structs. Each node is allocated via alloc_page() and mapped
> to a pfn_pool containing a next pointer, an atomic slot counter, and a
> PFN array that fills the remainder of the page.
>
> The tracking pages themselves are allocated via alloc_page(), which
> would trigger __pgalloc_tag_add() -> alloc_tag_add_early_pfn() and
> recurse indefinitely. Introduce __GFP_NO_CODETAG (reuses the
> %__GFP_NO_OBJ_EXT bit) and pass gfp_flags through pgalloc_tag_add()
> so that the early path can skip recording allocations that carry this
> flag.
AI review asked a couple of things. I have a feeling we saw at least
one of these, so probably already dealt with.
https://sashiko.dev/#/patchset/20260506022256.32664-1-hao.ge@linux.dev
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-09 0:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260506022256.32664-1-hao.ge@linux.dev>
2026-05-09 0:12 ` [PATCH v5] mm/alloc_tag: replace fixed-size early PFN array with dynamic linked list Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox