Re: [RFC PATCH v2 02/11] mm: change callers of __cpuset_zone_allowed to cpuset_zone_allowed
From: Balbir Singh
Date: Mon Dec 15 2025 - 01:14:24 EST
On 11/13/25 06:29, Gregory Price wrote:
> All current callers of __cpuset_zone_allowed() presently check if
> cpusets_enabled() is true first - which is the first check of the
> cpuset_zone_allowed() function.
>
> Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
> ---
> mm/compaction.c | 7 +++----
> mm/page_alloc.c | 19 ++++++++-----------
> 2 files changed, 11 insertions(+), 15 deletions(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 1e8f8eca318c..d2176935d3dd 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -2829,10 +2829,9 @@ enum compact_result try_to_compact_pages(gfp_t gfp_mask, unsigned int order,
> ac->highest_zoneidx, ac->nodemask) {
> enum compact_result status;
>
> - if (cpusets_enabled() &&
> - (alloc_flags & ALLOC_CPUSET) &&
> - !__cpuset_zone_allowed(zone, gfp_mask))
> - continue;
> + if ((alloc_flags & ALLOC_CPUSET) &&
> + !cpuset_zone_allowed(zone, gfp_mask))
> + continue;
>
Shouldn't this become one inline helper -- alloc_flags and cpuset_zone_allowed.
Balbir
<snip>