Re: [PATCH 1/6] mm/page_owner: extract skip_buddy_pages() helper to unify buddy page skipping
From: Andrew Morton
Date: Thu Jun 25 2026 - 17:55:44 EST
On Thu, 25 Jun 2026 15:31:08 +0800 Ye Liu <ye.liu@xxxxxxxxx> wrote:
>
>
> 在 2026/6/25 15:13, Vlastimil Babka (SUSE) 写道:
> > On 6/25/26 02:20, Andrew Morton wrote:
> >> 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.
> >
> > I got a bunch of "added to mm-hotfixes-unstable branch" mails, but this
> > seems like cleanups and nothing urgent? Was that intended?
Yeah, sorry, I soon after moved these into mm-new.
> >> A [0/N] cover letter is nice to have.
> >
> > Seems like it exists, but wasn't delivered. Lore shows its message id, but
> > as missing.
>
>
> Apologies, I accidentally sent the cover letter only to my own address.
> I'll ensure it goes to the mailing list in future submissions.
> Thanks for pointing it out.
>
> Subject: [PATCH 0/6] mm/page_owner: misc cleanups
Please send a full v2 to tidy all this up.