Re: [PATCH v2 1/7] mm: factor zone-device page init helpers out of __init_zone_device_page

From: Li Zhe

Date: Sun May 24 2026 - 23:52:48 EST


On Sat, 23 May 2026 15:10:52 +0300, rppt@xxxxxxxxxx wrote:

> On Thu, 21 May 2026 12:01:18 +0800, Li Zhe <lizhe.67@xxxxxxxxxxxxx> wrote:
> > diff --git a/mm/mm_init.c b/mm/mm_init.c
> > index f9f8e1af921c..4ba506df93bc 100644
> > --- a/mm/mm_init.c
> > +++ b/mm/mm_init.c
> > @@ -987,11 +987,36 @@ static void __init memmap_init(void)
> > }
> >
> > #ifdef CONFIG_ZONE_DEVICE
> > -static void __ref __init_zone_device_page(struct page *page, unsigned long pfn,
> > +static inline int zone_device_page_init_refcount(
> > + const struct dev_pagemap *pgmap)
>
> The name zone_device_page_init_refcount() implies that this function
> actually intializes the refcount, but it's actually used as a predicate
> based on pagemap properties, so let's make it bool and name accordingly.
> How about
>
> static inline bool pagemap_resets_refcount(const struct dev_pagemap *pagemap)
>
> Other than that:
>
> Reviewed-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>

Thanks, I will fix this in the next revision.

Thanks,
Zhe