All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@linux.vnet.ibm.com>
To: David Rientjes <rientjes@google.com>
Cc: Gautham R Shenoy <ego@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, peterz@infradead.org,
	penberg@kernel.org
Subject: Re: [PATCH] slub: Hold list_lock unconditionally before the call to add_full.
Date: Sat, 8 Feb 2014 08:30:56 +0530	[thread overview]
Message-ID: <20140208030056.GA9533@in.ibm.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1402071245350.4212@chino.kir.corp.google.com>

On Fri, Feb 07, 2014 at 12:46:19PM -0800, David Rientjes wrote:
> On Sat, 8 Feb 2014, Gautham R Shenoy wrote:
> 
> > Hi,
> > 
> > From the lockdep annotation and the comment that existed before the
> > lockdep annotations were introduced, 
> > mm/slub.c:add_full(s, n, page) expects to be called with n->list_lock
> > held.
> > 
> > However, there's a call path in deactivate_slab() when
> > 
> > 	 (new.inuse || n->nr_partial <= s->min_partial) &&
> > 	 !(new.freelist) &&
> >          !(kmem_cache_debug(s))
> > 
> > which ends up calling add_full() without holding
> > n->list_lock.
> > 
> > This was discovered while onlining/offlining cpus in 3.14-rc1 due to
> > the lockdep annotations added by commit
> > c65c1877bd6826ce0d9713d76e30a7bed8e49f38.
> > 
> > Fix this by unconditionally taking the lock
> > irrespective of the state of kmem_cache_debug(s).
> > 
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Pekka Enberg <penberg@kernel.org>
> > Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> 
> No, it's not needed unless kmem_cache_debug(s) is actually set, 
> specifically s->flags & SLAB_STORE_USER.
> 
> You want the patch at http://marc.info/?l=linux-kernel&m=139147105027693 
> instead which is already in -mm and linux-next.
>

Ah, thanks! Wasn't aware of this fix. Shall apply this one.

--
Thanks and Regards
gautham. 


      reply	other threads:[~2014-02-08  3:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 18:46 [PATCH] slub: Hold list_lock unconditionally before the call to add_full Gautham R Shenoy
2014-02-07 20:46 ` David Rientjes
2014-02-08  3:00   ` Gautham R Shenoy [this message]

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=20140208030056.GA9533@in.ibm.com \
    --to=ego@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.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 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.