Commit 6c382617 authored by Brendan Jackman's avatar Brendan Jackman Committed by Andrew Morton
Browse files

mm/page_alloc: harmonize should_compact_retry() type

Currently order is signed in one version of the function and unsigned in
the other. Tidy that up.

In page_alloc.c, order is unsigned in the vast majority of cases. But,
there is a cluster of exceptions in compaction-related code (probably
stemming from the fact that compact_control.order is signed). So, prefer
local consistency and make this one signed too.

Link: https://lkml.kernel.org/r/20250826-cleanup-should_compact_retry-v1-1-d2ca89727fcf@google.com


Signed-off-by: default avatarBrendan Jackman <jackmanb@google.com>
Reviewed-by: default avatarZi Yan <ziy@nvidia.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ef49b7b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4182,7 +4182,7 @@ __alloc_pages_direct_compact(gfp_t gfp_mask, unsigned int order,
}

static inline bool
should_compact_retry(struct alloc_context *ac, unsigned int order, int alloc_flags,
should_compact_retry(struct alloc_context *ac, int order, int alloc_flags,
		     enum compact_result compact_result,
		     enum compact_priority *compact_priority,
		     int *compaction_retries)