From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3C0AD531 for ; Fri, 1 Aug 2025 00:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.111 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754009972; cv=none; b=CA1pXBwWHgGgtsSyDmuxZEePJcc3HoI4tnM7Mwtg3srKEoWBz1RuleLB8CIgnb19GyJINUvrkKKpOUir+akpP6baLk1mfhyK1tzp1CNYadNiMmCKJ5HMLiGO2iwCh94GM98WsXibeA5IFaHe3V1EUuRdQu1R1UdKG8Oh8Hp2UuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754009972; c=relaxed/simple; bh=aJPdXU/BqhTVbziStCi0tpAMpCYu5ptfxhP3KWfLJ3I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=tpiAveLWx4pB2Tz8RSTCbZFLkt/F0ZDukirj4v+pa+JAVZhWra19VhkaHv2e4mrH1KiK8PqRoYvxTd6+IUVz+/JfYKc5eEFfBBUt72q4E3IetCNVk5OFfPfvGRLRNlgUwZcwzxyDfE4rwuVWKm6RivzitM5SOR2ECeMpOmEm8Wk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=a5+x+lWw; arc=none smtp.client-ip=115.124.30.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="a5+x+lWw" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1754009962; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=HWGSRyHKDYyYoQd9gVbPetRMPdyqFOTxvd9o21Vtc74=; b=a5+x+lWwgh27jIIgY1Ng78/Lz3Pz7f0MCjDGF/k80oOcADfZ73HBgHEGauL+8WoAx6aSScIQu0CwFXX9F2ZyaODCgGbvpkLvYZQABIGtOGVFHzvRbOoE8EJs3ZbiFv3go7GwIpM4tc4iCGSIiAhdQhKPXv7KpN5zXQp2mSN9iHg= Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0WkZQUTh_1754009960 cluster:ay36) by smtp.aliyun-inc.com; Fri, 01 Aug 2025 08:59:21 +0800 From: "Huang, Ying" To: Joshua Hahn Cc: Andrew Morton , SeongJae Park , David Hildenbrand , Zi Yan , Johannes Weiner , Matthew Brost , Rakie Kim , Byungchul Park , Gregory Price , Alistair Popple , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@meta.com Subject: Re: [PATCH v2] mempolicy: Clarify what zone reclaim means In-Reply-To: <20250731210738.1451854-1-joshua.hahnjy@gmail.com> (Joshua Hahn's message of "Thu, 31 Jul 2025 14:07:37 -0700") References: <20250731210738.1451854-1-joshua.hahnjy@gmail.com> Date: Fri, 01 Aug 2025 08:59:20 +0800 Message-ID: <87ectvamc7.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Joshua Hahn writes: > The zone_reclaim_mode API controls the reclaim behavior when a node runs out of > memory. Contrary to its user-facing name, it is internally referred to as > "node_reclaim_mode". > > This can be confusing. But because we cannot change the name of the API since > it has been in place since at least 2.6, let's try to be more explicit about > what the behavior of this API is. > > Change the description to clarify what zone reclaim entails, and be explicit > about the RECLAIM_ZONE bit, whose purpose has led to some confusion in the > past already [1] [2]. > > [1] https://lore.kernel.org/linux-mm/1579005573-58923-1-git-send-email-alex.shi@linux.alibaba.com/ > [2] https://lore.kernel.org/linux-mm/20200626003459.D8E015CA@viggo.jf.intel.com/ > > Signed-off-by: Joshua Hahn > --- > include/uapi/linux/mempolicy.h | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/include/uapi/linux/mempolicy.h b/include/uapi/linux/mempolicy.h > index 1f9bb10d1a47..6c9c9385ff89 100644 > --- a/include/uapi/linux/mempolicy.h > +++ b/include/uapi/linux/mempolicy.h > @@ -66,10 +66,16 @@ enum { > #define MPOL_F_MORON (1 << 4) /* Migrate On protnone Reference On Node */ > > /* > + * Enabling zone reclaim means the page allocator will attempt to fulfill > + * the allocation request on the current node by triggering reclaim and > + * trying to shrink the current node. > + * Fallback allocations on the next candidates in the zonelist are considered > + * zone when reclaim fails to free up enough memory in the current node/zone. > + * > * These bit locations are exposed in the vm.zone_reclaim_mode sysctl > * ABI. New bits are OK, but existing bits can never change. As far as I know, sysctl isn't considered kernel ABI now. So, cghane this line too? > */ > -#define RECLAIM_ZONE (1<<0) /* Run shrink_inactive_list on the zone */ > +#define RECLAIM_ZONE (1<<0) /* Enable zone reclaim */ > #define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */ > #define RECLAIM_UNMAP (1<<2) /* Unmap pages during reclaim */ > > > base-commit: 260f6f4fda93c8485c8037865c941b42b9cba5d2 --- Best Regards, Huang, Ying