Re: [PATCH v4 07/18] mm: move some stuff to mm/page_alloc.h

From: sashiko-bot

Date: Thu Jul 02 2026 - 07:23:38 EST


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Duplicate declaration of `drain_local_pages()` in `mm/page_alloc.h` contradicts the commit message.
--

commit 54f4dc2300a55c6c9cef3e3916ba57e09ad07e39
Author: Brendan Jackman <jackmanb@xxxxxxxxxx>

mm: move some stuff to mm/page_alloc.h

This commit shrinks the scope of several internal functions by moving their
declarations from the public include/linux/gfp.h header to the internal
mm/page_alloc.h header.

> diff --git a/mm/page_alloc.h b/mm/page_alloc.h
> index a4f4b325381ad..6bb50bae3ba27 100644
> --- a/mm/page_alloc.h
> +++ b/mm/page_alloc.h

[ ... ]

> @@ -266,6 +266,34 @@ static inline bool free_area_empty(struct free_area *area, int migratetype)
> return list_empty(&area->free_list[migratetype]);
> }
>
> +/* Convert GFP flags to their corresponding migrate type */
> +#define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE)

[ ... ]

> +bool decay_pcp_high(struct zone *zone, struct per_cpu_pages *pcp);
> +void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
> +void drain_all_pages(struct zone *zone);
> +void drain_local_pages(struct zone *zone);

[Severity: Low]
The commit message notes that drain_local_pages() is still used externally
and needs to stay behind in include/linux/gfp.h. Since it was successfully
left in the public header, is this declaration in mm/page_alloc.h an
accidental duplicate?

> +
> +void page_alloc_init_cpuhp(void);
> void page_alloc_sysctl_init(void);
>
> #endif /* __MM_PAGE_ALLOC_H */

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260702-alloc-trylock-v4-0-0af8ff387e80@xxxxxxxxxx?part=7