Re: [PATCH -V4 05/10] hugetlb: add charge/uncharge calls for HugeTLBalloc/free

From: Michal Hocko
Date: Thu Mar 29 2012 - 04:11:06 EST


On Wed 28-03-12 23:09:34, Aneesh Kumar K.V wrote:
> Michal Hocko <mhocko@xxxxxxx> writes:
>
> > On Fri 16-03-12 23:09:25, Aneesh Kumar K.V wrote:
> >> From: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
> >>
> >> This adds necessary charge/uncharge calls in the HugeTLB code
> >
> > This begs for more description...
> > Other than that it looks correct.
> >
>
> Updated as below
>
> hugetlb: add charge/uncharge calls for HugeTLB alloc/free
>
> This adds necessary charge/uncharge calls in the HugeTLB code. We do
> memcg charge in page alloc and uncharge in compound page destructor.
> We also need to ignore HugeTLB pages in __mem_cgroup_uncharge_common
> because that get called from delete_from_page_cache

and from mem_cgroup_end_migration used during soft_offline_page.

Btw., while looking at mem_cgroup_end_migration, I have noticed that you
need to take care of mem_cgroup_prepare_migration as well otherwise the
page would get charged as a normal (shmem) page.

>
> -aneesh
>
> --
> To unsubscribe from this list: send the line "unsubscribe cgroups" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/