lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/8] memcg: convert to use cgroup_is_descendant()
On Wed 24-07-13 18:01:25, Li Zefan wrote:
> This is a preparation to kill css_id.
>
> Signed-off-by: Li Zefan <lizefan@huawei.com>

css_is_ancestor doesn't depend on the depth of the hierarchy while
cgroup_is_descendant does. I do not think this would be an issue though
as __mem_cgroup_same_or_subtree is not called from any hot path.

Acked-by: Michal Hocko <mhocko@suse.cz>

> ---
> mm/memcontrol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d12ca6f..626c426 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1434,7 +1434,7 @@ bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg,
> return true;
> if (!root_memcg->use_hierarchy || !memcg)
> return false;
> - return css_is_ancestor(&memcg->css, &root_memcg->css);
> + return cgroup_is_descendant(memcg->css.cgroup, root_memcg->css.cgroup);
> }
>
> static bool mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg,
> --
> 1.8.0.2
>

--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2013-07-24 17:21    [W:0.117 / U:0.284 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site