linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: linuxppc-dev@ozlabs.org, Olaf Hering <olaf@aepfle.de>,
	linux-kernel@vger.kernel.org, Linux MM <linux-mm@kvack.org>
Subject: Re: crash in kmem_cache_init
Date: Thu, 17 Jan 2008 06:30:53 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0801170628580.19208@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <84144f020801170414q7d408a74uf47a84b777c36a4a@mail.gmail.com>

On Thu, 17 Jan 2008, Pekka Enberg wrote:

> Looks similar to the one discussed on linux-mm ("[BUG] at
> mm/slab.c:3320" thread). Christoph?

Right. Try the latest version of the patch to fix it:

Index: linux-2.6/mm/slab.c
===================================================================
--- linux-2.6.orig/mm/slab.c	2008-01-03 12:26:42.000000000 -0800
+++ linux-2.6/mm/slab.c	2008-01-09 15:59:49.000000000 -0800
@@ -2977,7 +2977,10 @@ retry:
 	}
 	l3 = cachep->nodelists[node];
 
-	BUG_ON(ac->avail > 0 || !l3);
+	if (!l3)
+		return NULL;
+
+	BUG_ON(ac->avail > 0);
 	spin_lock(&l3->list_lock);
 
 	/* See if we can refill from the shared array */
@@ -3224,7 +3227,7 @@ static void *alternate_node_alloc(struct
 		nid_alloc = cpuset_mem_spread_node();
 	else if (current->mempolicy)
 		nid_alloc = slab_node(current->mempolicy);
-	if (nid_alloc != nid_here)
+	if (nid_alloc != nid_here && node_state(nid_alloc, N_NORMAL_MEMORY))
 		return ____cache_alloc_node(cachep, flags, nid_alloc);
 	return NULL;
 }
@@ -3439,8 +3442,14 @@ __do_cache_alloc(struct kmem_cache *cach
 	 * We may just have run out of memory on the local node.
 	 * ____cache_alloc_node() knows how to locate memory on other nodes
 	 */
- 	if (!objp)
- 		objp = ____cache_alloc_node(cache, flags, numa_node_id());
+ 	if (!objp) {
+		int node_id = numa_node_id();
+		if (likely(cache->nodelists[node_id])) /* fast path */
+ 			objp = ____cache_alloc_node(cache, flags, node_id);
+		else /* this function can do good fallback */
+			objp = __cache_alloc_node(cache, flags, node_id,
+					__builtin_return_address(0));
+	}
 
   out:
 	return objp;

  reply	other threads:[~2008-01-17 14:30 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 15:09 crash in kmem_cache_init Olaf Hering
2008-01-15 15:58 ` Olaf Hering
2008-01-17 12:14 ` Pekka Enberg
2008-01-17 14:30   ` Christoph Lameter [this message]
2008-01-17 18:12     ` Olaf Hering
2008-01-17 18:58       ` Christoph Lameter
2008-01-17 19:54         ` Olaf Hering
2008-01-17 20:20           ` Olaf Hering
2008-01-19  4:56             ` Christoph Lameter
2008-01-17 21:15         ` Olaf Hering
2008-01-18  6:56           ` Olaf Hering
2008-01-18 18:42             ` Christoph Lameter
2008-01-19  4:55             ` Christoph Lameter
2008-01-18 18:47           ` Christoph Lameter
2008-01-18 21:30             ` Mel Gorman
2008-01-18 21:43               ` Christoph Lameter
2008-01-18 22:16               ` Christoph Lameter
2008-01-18 22:19                 ` Nish Aravamudan
2008-01-18 22:38                 ` Christoph Lameter
2008-01-18 22:57                 ` Olaf Hering
2008-01-22 19:54                   ` Mel Gorman
2008-01-22 20:11                     ` Christoph Lameter
2008-01-22 21:26                       ` Mel Gorman
2008-01-22 21:34                         ` Christoph Lameter
2008-01-22 22:50                           ` Mel Gorman
2008-01-22 22:57                             ` Christoph Lameter
2008-01-22 23:10                               ` Mel Gorman
2008-01-22 23:14                                 ` Christoph Lameter
2008-01-22 22:59                             ` Pekka Enberg
2008-01-22 23:12                               ` Christoph Lameter
2008-01-22 23:18                                 ` Christoph Lameter
2008-01-23  8:19                                   ` Pekka Enberg
2008-01-23  8:40                                     ` Olaf Hering
2008-01-22 21:45                     ` Olaf Hering
2008-01-22 22:12                       ` Nish Aravamudan
2008-01-22 22:23                       ` Christoph Lameter
2008-01-23  7:58                         ` Olaf Hering
2008-01-23 10:50                           ` Mel Gorman
2008-01-23 12:14                             ` Olaf Hering
2008-01-23 12:52                               ` Olaf Hering
2008-01-23 13:55                                 ` [PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node Mel Gorman
2008-01-23 14:18                                   ` Pekka J Enberg
2008-01-23 14:32                                     ` Pekka J Enberg
2008-01-23 14:49                                       ` Pekka J Enberg
2008-01-23 15:56                                         ` Mel Gorman
2008-01-23 17:29                                           ` Pekka J Enberg
2008-01-23 17:42                                             ` Pekka J Enberg
2008-01-23 18:51                                             ` Christoph Lameter
2008-01-23 19:52                                             ` Nishanth Aravamudan
2008-01-23 21:02                                               ` Pekka Enberg
2008-01-23 21:14                                                 ` Christoph Lameter
2008-01-23 21:36                                                   ` Nishanth Aravamudan
2008-01-24  3:13                                                     ` Christoph Lameter
2008-01-23 18:36                                         ` Christoph Lameter
2008-01-23 18:35                                     ` Christoph Lameter
2008-01-23 14:27                                   ` Olaf Hering
2008-01-23 14:42                                     ` Mel Gorman
2008-01-23 18:41                                   ` Christoph Lameter
2008-01-23 13:41                               ` crash in kmem_cache_init Mel Gorman
2008-01-18 18:51           ` Christoph Lameter
2008-01-17 19:03       ` Christoph Lameter

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.0801170628580.19208@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olaf@aepfle.de \
    --cc=penberg@cs.helsinki.fi \
    /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;
as well as URLs for NNTP newsgroup(s).