mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Srihari Vijayaraghavan <sriharivijayaraghavan@yahoo.com.au>,
	Hugh Dickins <hugh@veritas.com>, Ingo Molnar <mingo@elte.hu>,
	Oliver Xymoron <oxymoron@waste.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PROBLEM] 2.6.22-rc2 panics on x86-64 with slub
Date: Fri, 25 May 2007 18:52:30 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705251850350.9013@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070525061200.GG7653@kernel.dk>

I finally figured out the second issue. Took some time to get that figure 
out. Sorry. But now all the bug reports make sense.

Here is the fix


SLUB: Fix NUMA / SYSFS bootstrap issue

The kmem_cache_node cache is very special because it is needed for
NUMA bootstrap. Under certain conditions (like for example if lockdep is
enabled and significantly increases the size of spinlock_t) the structure
may become exactly the size as one of the larger caches in the kmalloc array.

That early during bootstrap we cannot perform merging properly. The unique
id for the kmem_cache_node cache will match one of the kmalloc array. Sysfs
will complain about a duplicate directory entry. All of this occurs while
the console is not yet fully operational. Thus boot may appear to be
silently failing.

The kmem_cache_node cache is very special. During early boostrap the main
allocation function is not operational yet and so we have to run our
own small special alloc function during early boot. It is also special in
that it is never freed.

We really do not want any merging on that cache. Set the refcount -1 and
forbid merging of slabs that have a negative refcount.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

---
 mm/slub.c |    7 +++++++
 1 file changed, 7 insertions(+)

Index: slub/mm/slub.c
===================================================================
--- slub.orig/mm/slub.c	2007-05-25 18:28:42.000000000 -0700
+++ slub/mm/slub.c	2007-05-25 18:29:46.000000000 -0700
@@ -2473,6 +2473,7 @@ void __init kmem_cache_init(void)
 	 */
 	create_kmalloc_cache(&kmalloc_caches[0], "kmem_cache_node",
 		sizeof(struct kmem_cache_node), GFP_KERNEL);
+	kmalloc_caches[0].refcount = -1;
 #endif
 
 	/* Able to allocate the per node structures */
@@ -2520,6 +2521,12 @@ static int slab_unmergeable(struct kmem_
 	if (s->ctor)
 		return 1;
 
+	/*
+	 * We may have set a slab to be unmergeable during bootstrap.
+	 */
+	if (s->refcount < 0)
+		return 1;
+
 	return 0;
 }
 

  parent reply	other threads:[~2007-05-26  1:52 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-20 13:35 Srihari Vijayaraghavan
2007-05-21 16:30 ` Christoph Lameter
2007-05-21 17:41   ` Hugh Dickins
2007-05-21 18:25     ` Christoph Lameter
2007-05-21 18:44       ` Hugh Dickins
2007-05-21 18:48         ` Christoph Lameter
2007-05-21 19:00           ` Jens Axboe
2007-05-21 19:06             ` Hugh Dickins
2007-05-21 19:09               ` Jens Axboe
2007-05-21 19:13             ` Christoph Lameter
2007-05-21 19:26               ` Jens Axboe
2007-05-21 19:29               ` Hugh Dickins
2007-05-21 19:34                 ` Christoph Lameter
2007-05-21 22:27                 ` Christoph Lameter
2007-05-21 23:46                   ` Christoph Lameter
2007-05-22  7:07                   ` Jens Axboe
2007-05-22  8:26                     ` Srihari Vijayaraghavan
2007-05-22  9:24                       ` Ingo Molnar
2007-05-22 11:01                         ` Srihari Vijayaraghavan
2007-05-22 11:20                           ` Ingo Molnar
2007-05-22 11:26                             ` Srihari Vijayaraghavan
2007-05-22 13:01                           ` Hugh Dickins
2007-05-22 15:36                             ` Jens Axboe
2007-05-22 18:30                               ` Christoph Lameter
2007-05-22 20:10                                 ` Jens Axboe
2007-05-22 22:15                             ` Srihari Vijayaraghavan
2007-05-22 22:25                               ` Christoph Lameter
2007-05-23  7:11                                 ` Jens Axboe
2007-05-23 17:04                                   ` Christoph Lameter
2007-05-24  7:25                                     ` Jens Axboe
2007-05-24 16:55                                       ` Christoph Lameter
2007-05-25  6:12                                         ` Jens Axboe
2007-05-25 13:40                                           ` Christoph Lameter
2007-05-25 14:00                                             ` Jens Axboe
2007-05-26  1:52                                           ` Christoph Lameter [this message]
2007-05-26  2:49                                             ` Srihari Vijayaraghavan
2007-05-23 10:18                                 ` Srihari Vijayaraghavan
2007-05-23 17:10                                   ` Christoph Lameter
2007-05-23 17:19                                   ` Christoph Lameter
2007-05-23 22:23                                     ` Srihari Vijayaraghavan
2007-05-23 22:32                                       ` Christoph Lameter
2007-05-24 13:12                                         ` Srihari Vijayaraghavan
2007-05-24 16:58                                           ` Christoph Lameter
2007-05-24 21:30                                             ` Srihari Vijayaraghavan
2007-05-24 22:19                                               ` Christoph Lameter
2007-05-24 22:39                                                 ` Srihari Vijayaraghavan
2007-05-21 19:04           ` Hugh Dickins
  -- strict thread matches above, loose matches on Subject: below --
2007-05-20  3:09 Srihari Vijayaraghavan
2007-05-20  7:12 ` Christoph Lameter
2007-05-20  7:40   ` Srihari Vijayaraghavan
2007-05-20 13:24     ` Satyam Sharma
2007-05-20 13:37       ` Srihari Vijayaraghavan

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=Pine.LNX.4.64.0705251850350.9013@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oxymoron@waste.org \
    --cc=sriharivijayaraghavan@yahoo.com.au \
    /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

all inboxes | Powered by JetHome®