linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Fengguang Wu <fengguang.wu@intel.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: Pekka Enberg <penberg@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [slub] WARNING: CPU: 0 PID: 0 at mm/slub.c:1511 __kmem_cache_create()
Date: Tue, 14 Jan 2014 09:31:27 -0800	[thread overview]
Message-ID: <52D5746F.2040604@intel.com> (raw)
In-Reply-To: <20140114131915.GA26942@localhost>

[-- Attachment #1: Type: text/plain, Size: 447 bytes --]

> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=c65c1877bd6826ce0d9713d76e30a7bed8e49f38

I think the assert is just bogus at least in the early case.
early_kmem_cache_node_alloc() says:
 * No kmalloc_node yet so do it by hand. We know that this is the first
 * slab on the node for this slabcache. There are no concurrent accesses
 * possible.

Should we do something like the attached patch?  (very lightly tested)

[-- Attachment #2: slub-lockdep-workaround.patch --]
[-- Type: text/x-patch, Size: 653 bytes --]



---

 b/mm/slub.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN mm/slub.c~slub-lockdep-workaround mm/slub.c
--- a/mm/slub.c~slub-lockdep-workaround	2014-01-14 09:19:22.418942641 -0800
+++ b/mm/slub.c	2014-01-14 09:29:55.441297460 -0800
@@ -2890,7 +2890,13 @@ static void early_kmem_cache_node_alloc(
 	init_kmem_cache_node(n);
 	inc_slabs_node(kmem_cache_node, node, page->objects);
 
+	/*
+	 * the lock is for lockdep's sake, not for any actual
+	 * race protection
+	 */
+	spin_lock(&n->list_lock);
 	add_partial(n, page, DEACTIVATE_TO_HEAD);
+	spin_unlock(&n->list_lock);
 }
 
 static void free_kmem_cache_nodes(struct kmem_cache *s)
_

  reply	other threads:[~2014-01-14 17:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 13:19 Fengguang Wu
2014-01-14 17:31 ` Dave Hansen [this message]
2014-01-15  0:36   ` 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=52D5746F.2040604@intel.com \
    --to=dave.hansen@intel.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=peterz@infradead.org \
    /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