[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5480f0ea-0e5f-30c2-7635-43b8cbbb3a73@oracle.com>
Date: Wed, 5 Feb 2020 15:26:56 -0800
From: Mike Kravetz <mike.kravetz@...cle.com>
To: Mina Almasry <almasrymina@...gle.com>
Cc: shuah@...nel.org, rientjes@...gle.com, shakeelb@...gle.com,
gthelen@...gle.com, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [PATCH v11 3/9] hugetlb_cgroup: add reservation accounting for
private mappings
On 2/3/20 3:22 PM, Mina Almasry wrote:
> Normally the pointer to the cgroup to uncharge hangs off the struct
> page, and gets queried when it's time to free the page. With
> hugetlb_cgroup reservations, this is not possible. Because it's possible
> for a page to be reserved by one task and actually faulted in by another
> task.
>
> The best place to put the hugetlb_cgroup pointer to uncharge for
> reservations is in the resv_map. But, because the resv_map has different
> semantics for private and shared mappings, the code patch to
> charge/uncharge shared and private mappings is different. This patch
> implements charging and uncharging for private mappings.
>
> For private mappings, the counter to uncharge is in
> resv_map->reservation_counter. On initializing the resv_map this is set
> to NULL. On reservation of a region in private mapping, the tasks
> hugetlb_cgroup is charged and the hugetlb_cgroup is placed is
> resv_map->reservation_counter.
>
> On hugetlb_vm_op_close, we uncharge resv_map->reservation_counter.
>
> Signed-off-by: Mina Almasry <almasrymina@...gle.com>
> Reviewed-by: Mike Kravetz <mike.kravetz@...cle.com>
> Acked-by: David Rientjes <rientjes@...gle.com>
>
> ---
>
> Changes in v11:
> - Refactored hugetlb_cgroup_uncharge_conuter a bit to eliminate
> unnecessary #ifdefs.
> - Added resv_map_set_hugetlb_cgroup_uncharge_info() to eliminate #ifdefs
> in the middle of hugetlb logic.
Thanks.
Code looks better without the #ifdefs.
You can keep my Reviewed-by:
--
Mike Kravetz
Powered by blists - more mailing lists