[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160802155120.GA28900@dhcp22.suse.cz>
Date: Tue, 2 Aug 2016 17:51:21 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Vladimir Davydov <vdavydov@...tuozzo.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] mm: memcontrol: add sanity checks for memcg->id.ref
on get/put
On Tue 02-08-16 14:45:03, Michal Hocko wrote:
> 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?
Scratch that. I got it. root will never get its count down to 0. Sorry
about the noise.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists