Re: [PATCH v2 1/3] mm/page_alloc: drop unused gfp_mask from zone_watermark_fast()
From: Joshua Hahn
Date: Wed Nov 18 2026 - 13:36:22 EST
On Wed, Nov 18, 2026 at 09:12:51PM +0530, Dev Jain wrote:
> + Kiryl if he has different opinions
>
> On 18/11/26 8:29 pm, Dev Jain wrote:
> >
> >
> > On 17/11/26 4:53 am, Joshua Hahn wrote:
> >> zone_watermark_fast() has not used its gfp_mask argument since commit
> >> 2973d8229b78 ("mm: discard __GFP_ATOMIC") switched the watermark boost
> >> check from __GFP_ATOMIC to ALLOC_MIN_RESERVE.
> >>
> >> Remove the argument, no functional changes intended.
> >>
> >> Reviewed-by: SJ Park <sj@xxxxxxxxxx>
> >> Reviewed-by: Chris Down <chris@xxxxxxxxxxxxxx>
> >> Reviewed-by: Zi Yan <ziy@xxxxxxxxxx>
> >> Signed-off-by: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>
> >> ---
> >
> > Note that this series:
> > https://lore.kernel.org/all/20261116125103.2894162-1-kas@xxxxxxxxxx/
> >
> > needs to use the gfp mask. So perhaps drop this patch? Otherwise we will
> > just make noise on the list by adding it back :)
Hi Dev,
Thank you for your review on the series. Also, this was a really good
catch, thanks a lot! I'll just drop this as it was just meant to be a
cleanup if there was no new user, but it seems like there will be a
real usecase.
Have a great day!
Joshua
> >> mm/page_alloc.c | 12 +++++-------
> >> 1 file changed, 5 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> >> index 9e1261521b6a3..4d829e5eac49d 100644
> >> --- a/mm/page_alloc.c
> >> +++ b/mm/page_alloc.c
> >> @@ -3675,7 +3675,7 @@ bool zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark,
> >>
> >> static inline bool zone_watermark_fast(struct zone *z, unsigned int order,
> >> unsigned long mark, int highest_zoneidx,
> >> - unsigned int alloc_flags, gfp_t gfp_mask)
> >> + unsigned int alloc_flags)
> >> {
> >> long free_pages;
> >>
> >> @@ -3877,7 +3877,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
> >> !waitqueue_active(&zone->zone_pgdat->kswapd_wait)) {
> >> mark = wmark_pages(zone, kswapd_watermark);
> >> if (!zone_watermark_fast(zone, order, mark,
> >> - ac->highest_zoneidx, 0, gfp_mask)) {
> >> + ac->highest_zoneidx, 0)) {
> >> skipped_kswapd_nodes = true;
> >> continue;
> >> }
> >> @@ -3897,8 +3897,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
> >>
> >> mark = high_wmark_pages(zone);
> >> if (zone_watermark_fast(zone, order, mark,
> >> - ac->highest_zoneidx, alloc_flags,
> >> - gfp_mask))
> >> + ac->highest_zoneidx, alloc_flags))
> >> goto try_this_zone;
> >> else
> >> set_bit(ZONE_BELOW_HIGH, &zone->flags);
> >> @@ -3906,8 +3905,7 @@ get_page_from_freelist(gfp_t gfp_mask, unsigned int order, int alloc_flags,
> >> check_alloc_wmark:
> >> mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK);
> >> if (!zone_watermark_fast(zone, order, mark,
> >> - ac->highest_zoneidx, alloc_flags,
> >> - gfp_mask)) {
> >> + ac->highest_zoneidx, alloc_flags)) {
> >> if (cond_accept_memory(zone, order, alloc_flags))
> >> goto try_this_zone;
> >>
> >> @@ -5245,7 +5243,7 @@ unsigned long alloc_pages_bulk_noprof(gfp_t gfp, int preferred_nid,
> >> mark = wmark_pages(zone, alloc_flags & ALLOC_WMARK_MASK) + nr_pages - nr_populated;
> >> if (zone_watermark_fast(zone, 0, mark,
> >> zonelist_zone_idx(ac.preferred_zoneref),
> >> - alloc_flags, gfp)) {
> >> + alloc_flags)) {
> >> break;
> >> }
> >>
> >
>