linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Vladimir Davydov <vdavydov@parallels.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Christoph Lameter <cl@linux.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Pekka Enberg <penberg@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch 1/2] mm, slub: fix false-positive lockdep warning in free_partial()
Date: Thu, 24 Jul 2014 15:18:27 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1407241517440.19906@chino.kir.corp.google.com> (raw)
In-Reply-To: <20140724122143.GI1725@cmpxchg.org>

On Thu, 24 Jul 2014, Johannes Weiner wrote:

> > diff --git a/mm/slub.c b/mm/slub.c
> > --- a/mm/slub.c
> > +++ b/mm/slub.c
> > @@ -3195,12 +3195,13 @@ static void list_slab_objects(struct kmem_cache *s, struct page *page,
> >  /*
> >   * Attempt to free all partial slabs on a node.
> >   * This is called from kmem_cache_close(). We must be the last thread
> > - * using the cache and therefore we do not need to lock anymore.
> > + * using the cache, but we still have to lock for lockdep's sake.
> >   */
> >  static void free_partial(struct kmem_cache *s, struct kmem_cache_node *n)
> >  {
> >  	struct page *page, *h;
> >  
> > +	spin_lock_irq(&n->list_lock);
> >  	list_for_each_entry_safe(page, h, &n->partial, lru) {
> >  		if (!page->inuse) {
> >  			__remove_partial(n, page);
> 
> This already uses __remove_partial(), which does not have the lockdep
> assertion.  You even acked the patch that made this change, why add
> the spinlock now?
> 

Yup, thanks.  This was sitting in Pekka's slab/next branch but isn't 
actually needed after commit 1e4dd9461fab ("slub: do not assert not 
having lock in removing freed partial").  Good catch!

--
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>

  reply	other threads:[~2014-07-24 22:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 22:57 [patch 0/2] mm, slub: remaining changes for -mm David Rientjes
2014-07-22 22:57 ` [patch 1/2] mm, slub: fix false-positive lockdep warning in free_partial() David Rientjes
2014-07-24 12:21   ` Johannes Weiner
2014-07-24 22:18     ` David Rientjes [this message]
2014-07-22 22:58 ` [patch 2/2] mm, slub: fix some indenting in cmpxchg_double_slab() David Rientjes

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=alpine.DEB.2.02.1407241517440.19906@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=vdavydov@parallels.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox