Re: [RFC PATCH v5 1/4] mm: add page_counter_margin()

"David Hildenbrand (Arm)" <[email protected]> Thu, 6 Aug 2026 15:51:49 +0200
Newsgroups org.kernel.vger.cgroups,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On 7/30/26 14:23, Xueyuan Chen wrote:
> From: Johannes Weiner <[email protected]>
> 
> mem_cgroup_get_nr_swap_pages() open-codes the remaining capacity across
> the memcg swap counter hierarchy.
> 
> Add page_counter_margin() to return the minimum usable space from a page
> counter to the root, and use it in mem_cgroup_get_nr_swap_pages(). This
> is a pure refactoring with no intended behavior change.
> 
> Signed-off-by: Johannes Weiner <[email protected]>
> Signed-off-by: Xueyuan Chen <[email protected]>
> ---

Reviewed-by: David Hildenbrand (Arm) <[email protected]>

-- 
Cheers,

David