All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov@parallels.com>
To: Christoph Lameter <cl@gentwo.org>
Cc: akpm@linux-foundation.org, mhocko@suse.cz, hannes@cmpxchg.org,
	glommer@gmail.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm 2/8] memcg: keep all children of each root cache on a list
Date: Mon, 7 Jul 2014 19:45:46 +0400	[thread overview]
Message-ID: <20140707154546.GI13827@esperanza> (raw)
In-Reply-To: <alpine.DEB.2.11.1407071022200.22121@gentwo.org>

On Mon, Jul 07, 2014 at 10:24:35AM -0500, Christoph Lameter wrote:
> On Mon, 7 Jul 2014, Vladimir Davydov wrote:
> 
> > diff --git a/mm/slab_common.c b/mm/slab_common.c
> > index d31c4bacc6a2..95a8f772b0d1 100644
> > --- a/mm/slab_common.c
> > +++ b/mm/slab_common.c
> > @@ -294,8 +294,12 @@ struct kmem_cache *memcg_create_kmem_cache(struct mem_cgroup *memcg,
> >  	if (IS_ERR(s)) {
> >  		kfree(cache_name);
> >  		s = NULL;
> > +		goto out_unlock;
> >  	}
> >
> > +	list_add(&s->memcg_params->siblings,
> > +		 &root_cache->memcg_params->children);
> > +
> >  out_unlock:
> >  	mutex_unlock(&slab_mutex);
> >
> 
> If there is an error then s is set to NULL. And then
> the list_add is done dereferencing s?

No, we skip list_add on error. I think you missed "goto out_unlock"
right after "s = NULL" (btw do_kmem_cache_create never returns NULL).

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Davydov <vdavydov@parallels.com>
To: Christoph Lameter <cl@gentwo.org>
Cc: <akpm@linux-foundation.org>, <mhocko@suse.cz>,
	<hannes@cmpxchg.org>, <glommer@gmail.com>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -mm 2/8] memcg: keep all children of each root cache on a list
Date: Mon, 7 Jul 2014 19:45:46 +0400	[thread overview]
Message-ID: <20140707154546.GI13827@esperanza> (raw)
In-Reply-To: <alpine.DEB.2.11.1407071022200.22121@gentwo.org>

On Mon, Jul 07, 2014 at 10:24:35AM -0500, Christoph Lameter wrote:
> On Mon, 7 Jul 2014, Vladimir Davydov wrote:
> 
> > diff --git a/mm/slab_common.c b/mm/slab_common.c
> > index d31c4bacc6a2..95a8f772b0d1 100644
> > --- a/mm/slab_common.c
> > +++ b/mm/slab_common.c
> > @@ -294,8 +294,12 @@ struct kmem_cache *memcg_create_kmem_cache(struct mem_cgroup *memcg,
> >  	if (IS_ERR(s)) {
> >  		kfree(cache_name);
> >  		s = NULL;
> > +		goto out_unlock;
> >  	}
> >
> > +	list_add(&s->memcg_params->siblings,
> > +		 &root_cache->memcg_params->children);
> > +
> >  out_unlock:
> >  	mutex_unlock(&slab_mutex);
> >
> 
> If there is an error then s is set to NULL. And then
> the list_add is done dereferencing s?

No, we skip list_add on error. I think you missed "goto out_unlock"
right after "s = NULL" (btw do_kmem_cache_create never returns NULL).

Thanks.

  reply	other threads:[~2014-07-07 15:45 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 12:00 [PATCH -mm 0/8] memcg: reparent kmem on css offline Vladimir Davydov
2014-07-07 12:00 ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 1/8] memcg: add pointer from memcg_cache_params to owner cache Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 2/8] memcg: keep all children of each root cache on a list Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 15:24   ` Christoph Lameter
2014-07-07 15:24     ` Christoph Lameter
2014-07-07 15:45     ` Vladimir Davydov [this message]
2014-07-07 15:45       ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 3/8] slab: guarantee unique kmem cache naming Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 4/8] slub: remove kmemcg id from create_unique_id Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 5/8] memcg: rework non-slab kmem pages charge path Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 6/8] memcg: introduce kmem context Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 7/8] memcg: move some kmem definitions upper Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 12:00 ` [PATCH -mm 8/8] memcg: reparent kmem context on memcg offline Vladimir Davydov
2014-07-07 12:00   ` Vladimir Davydov
2014-07-07 14:25 ` [PATCH -mm 0/8] memcg: reparent kmem on css offline Johannes Weiner
2014-07-07 14:25   ` Johannes Weiner
2014-07-07 15:40   ` Vladimir Davydov
2014-07-07 15:40     ` Vladimir Davydov
2014-07-08 22:05     ` Johannes Weiner
2014-07-08 22:05       ` Johannes Weiner
2014-07-09  7:25       ` Vladimir Davydov
2014-07-09  7:25         ` Vladimir Davydov
2014-07-07 17:14   ` Vladimir Davydov
2014-07-07 17:14     ` Vladimir Davydov
2014-07-08 22:19     ` Johannes Weiner
2014-07-08 22:19       ` Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140707154546.GI13827@esperanza \
    --to=vdavydov@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@gentwo.org \
    --cc=glommer@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.