Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-19 Thread Michal Hocko
On Thu 19-07-12 16:56:18, Aneesh Kumar K.V wrote: > Kamezawa Hiroyuki writes: > > > > > We test RES_USAGE before taking hugetlb_lock. What prevents some other > > thread from increasing RES_USAGE after that test? > > > > After walking the list we test RES_USAGE after dropping

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-19 Thread Aneesh Kumar K.V
Kamezawa Hiroyuki writes: > > We test RES_USAGE before taking hugetlb_lock. What prevents some other > thread from increasing RES_USAGE after that test? > > After walking the list we test RES_USAGE after dropping hugetlb_lock. > What prevents another thread from increment

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-19 Thread Kamezawa Hiroyuki
(2012/07/19 18:41), Aneesh Kumar K.V wrote: Li Zefan writes: on 2012/7/19 10:55, Aneesh Kumar K.V wrote: Andrew Morton writes: On Wed, 18 Jul 2012 11:04:09 +0530 "Aneesh Kumar K.V" wrote: From: "Aneesh Kumar K.V" Since we cannot fail in hugetlb_cgroup_move_parent, we don't really nee

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-19 Thread Aneesh Kumar K.V
Li Zefan writes: > on 2012/7/19 10:55, Aneesh Kumar K.V wrote: > >> Andrew Morton writes: >> >>> On Wed, 18 Jul 2012 11:04:09 +0530 >>> "Aneesh Kumar K.V" wrote: >>> From: "Aneesh Kumar K.V" Since we cannot fail in hugetlb_cgroup_move_parent, we don't really need to check

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-19 Thread Li Zefan
on 2012/7/19 10:55, Aneesh Kumar K.V wrote: > Andrew Morton writes: > >> On Wed, 18 Jul 2012 11:04:09 +0530 >> "Aneesh Kumar K.V" wrote: >> >>> From: "Aneesh Kumar K.V" >>> >>> Since we cannot fail in hugetlb_cgroup_move_parent, we don't really >>> need to check whether cgroup have any change

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-18 Thread Aneesh Kumar K.V
Andrew Morton writes: > On Wed, 18 Jul 2012 11:04:09 +0530 > "Aneesh Kumar K.V" wrote: > >> From: "Aneesh Kumar K.V" >> >> Since we cannot fail in hugetlb_cgroup_move_parent, we don't really >> need to check whether cgroup have any change left after that. Also skip >> those hstates for which w

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-18 Thread Andrew Morton
On Wed, 18 Jul 2012 11:04:09 +0530 "Aneesh Kumar K.V" wrote: > From: "Aneesh Kumar K.V" > > Since we cannot fail in hugetlb_cgroup_move_parent, we don't really > need to check whether cgroup have any change left after that. Also skip > those hstates for which we don't have any charge in this cg

Re: [PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-18 Thread Wanpeng Li
On Wed, Jul 18, 2012 at 11:04:09AM +0530, Aneesh Kumar K.V wrote: >From: "Aneesh Kumar K.V" > >Since we cannot fail in hugetlb_cgroup_move_parent, we don't really >need to check whether cgroup have any change left after that. Also skip >those hstates for which we don't have any charge in this cgro

[PATCH] hugetlb/cgroup: Simplify pre_destroy callback

2012-07-17 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Since we cannot fail in hugetlb_cgroup_move_parent, we don't really need to check whether cgroup have any change left after that. Also skip those hstates for which we don't have any charge in this cgroup. Based on an earlier patch from Wanpeng Li Signed-off-by: Aneesh