Re: [PATCH 1/6] mm/page_owner: extract skip_buddy_pages() helper to unify buddy page skipping
From: Andrew Morton
Date: Wed Jun 24 2026 - 20:22:32 EST
On Tue, 23 Jun 2026 14:52:26 +0800 Ye Liu <ye.liu@xxxxxxxxx> 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.
All looks nice, thanks.
A [0/N] cover letter is nice to have.
AI review identified a few possible pre-existing issues, if you're
interested:
https://sashiko.dev/#/patchset/20260623065234.31866-2-ye.liu@xxxxxxxxx