lkml.org 
[lkml]   [2016]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] mm: memcontrol: add sanity checks for memcg->id.ref on get/put
On Mon 01-08-16 16:26:26, Vladimir Davydov wrote:
[...]
> static struct mem_cgroup *mem_cgroup_id_get_active(struct mem_cgroup *memcg)
> {
> - while (!atomic_inc_not_zero(&memcg->id.ref))
> + while (!atomic_inc_not_zero(&memcg->id.ref)) {
> + VM_BUG_ON(mem_cgroup_is_root(memcg));
> memcg = parent_mem_cgroup(memcg);
> + }

why is this BUG_ON ok? What if the root.use_hierarchy=true?

> return memcg;
> }
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2016-08-02 15:41    [W:0.506 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site