Re: [PATCH v2 1/6] mm/page_owner: extract skip_buddy_pages() helper to unify buddy page skipping
From: Zi Yan
Date: Fri Jun 26 2026 - 14:36:06 EST
On Thu Jun 25, 2026 at 10:45 PM EDT, Ye Liu wrote:
> Three places in page_owner.c duplicate the same pattern: check if a
> page is PageBuddy, read its order via buddy_order_unsafe(), advance
> the pfn past the buddy block if the order is valid, and continue.
>
> Consolidate them into a single inline helper skip_buddy_pages().
> The function returns true (skip) for any buddy page and advances
> @pfn past the block when the order is valid; returns false if the
> page is not a buddy page and should be processed normally.
>
> The old init_pages_in_zone() variant used "order > 0" as an extra
> guard before advancing pfn, but the continue was unconditional and
> (1UL << 0) - 1 == 0, so the behaviour is identical. The comment
> about zone->lock is preserved in the helper's kernel-doc.
>
> No functional change.
>
> Signed-off-by: Ye Liu <ye.liu@xxxxxxxxx>
> ---
> mm/page_owner.c | 52 ++++++++++++++++++++++++-------------------------
> 1 file changed, 26 insertions(+), 26 deletions(-)
>
LGTM.
Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
--
Best Regards,
Yan, Zi