Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455494

Re: [PATCH 3/3] mm: memcontrol: add sanity checks for memcg->id.ref on get/put

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] mm: memcontrol: add sanity checks for memcg->id.ref on get/put
Date 2016-08-03 00:00 +0200
Message-ID <s1PTb-1PI-1@gated-at.bofh.it> (permalink)
References <s1HiX-4uK-63@gated-at.bofh.it> <s1HiX-4uK-65@gated-at.bofh.it> <s1HiX-4uK-61@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3/3] mm: memcontrol: add sanity checks for memcg->id.ref  on get/put Michal Hocko <mhocko@kernel.org> - 2016-08-02 14:50 +0200
  Re: [PATCH 3/3] mm: memcontrol: add sanity checks for memcg->id.ref  on get/put Michal Hocko <mhocko@kernel.org> - 2016-08-03 00:00 +0200

csiph-web