[PATCH] Fix boot problem in situations where the boot CPU is running on a memoryless node

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>, Christoph Lameter <clameter@...>, Pekka Enberg <penberg@...>
Cc: <linux-kernel@...>, <linuxppc-dev@...>, Aneesh Kumar K.V <aneesh.kumar@...>, hanth Aravamudan <nacc@...>, KAMEZAWA Hiroyuki <kamezawa.hiroyu@...>, <lee.schermerhorn@...>, Linux MM <linux-mm@...>, Olaf Hering <olaf@...>
Date: Wednesday, January 23, 2008 - 9:55 am

This patch in combination with a partial revert of commit
04231b3002ac53f8a64a7bd142fde3fa4b6808c6 fixes a regression between 2.6.23
and 2.6.24-rc8 where a PPC64 machine with all CPUS on a memoryless node fails
to boot. If approved by the SLAB maintainers, it should be merged for 2.6.24.

With memoryless-node configurations, it is possible that all the CPUs are
associated with a node with no memory. Early in the boot process, nodelists
are not setup that allow fallback_alloc to work, an Oops occurs and the
machine fails to boot.

This patch adds the necessary checks to make sure a kmem_list3 exists for
the preferred node used when growing the cache. If the preferred node has
no nodelist then the currently running node is used instead. This
problem only affects the SLAB allocator, SLUB appears to work fine.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>

---
 mm/slab.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.24-rc8-005-revert-memoryless-slab/mm/slab.c linux-2.6.24-rc8-010_handle_missing_l3/mm/slab.c
--- linux-2.6.24-rc8-005-revert-memoryless-slab/mm/slab.c	2008-01-22 17:46:32.000000000 +0000
+++ linux-2.6.24-rc8-010_handle_missing_l3/mm/slab.c	2008-01-22 18:42:53.000000000 +0000
@@ -2775,6 +2775,11 @@ static int cache_grow(struct kmem_cache 
 	/* Take the l3 list lock to change the colour_next on this node */
 	check_irq_off();
 	l3 = cachep->nodelists[nodeid];
+	if (!l3) {
+		nodeid = numa_node_id();
+		l3 = cachep->nodelists[nodeid];
+	}
+	BUG_ON(!l3);
 	spin_lock(&l3->list_lock);
 
 	/* Get colour for the slab, and cal the next value. */
@@ -3317,6 +3322,10 @@ static void *____cache_alloc_node(struct
 	int x;
 
 	l3 = cachep->nodelists[nodeid];
+	if (!l3) {
+		nodeid = numa_node_id();
+		l3 = cachep->nodelists[nodeid];
+	}
 	BUG_ON(!l3);
 
 retry:

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
crash in kmem_cache_init, Olaf Hering, (Tue Jan 15, 11:09 am)
Re: crash in kmem_cache_init, Pekka Enberg, (Thu Jan 17, 8:14 am)
Re: crash in kmem_cache_init, Christoph Lameter, (Thu Jan 17, 10:30 am)
Re: crash in kmem_cache_init, Olaf Hering, (Thu Jan 17, 2:12 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Thu Jan 17, 3:03 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Thu Jan 17, 2:58 pm)
Re: crash in kmem_cache_init, Olaf Hering, (Thu Jan 17, 5:15 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Fri Jan 18, 2:51 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Fri Jan 18, 2:47 pm)
Re: crash in kmem_cache_init, Mel Gorman, (Fri Jan 18, 5:30 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Fri Jan 18, 6:16 pm)
Re: crash in kmem_cache_init, Olaf Hering, (Fri Jan 18, 6:57 pm)
Re: crash in kmem_cache_init, Mel Gorman, (Tue Jan 22, 3:54 pm)
Re: crash in kmem_cache_init, Olaf Hering, (Tue Jan 22, 5:45 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Tue Jan 22, 6:23 pm)
Re: crash in kmem_cache_init, Olaf Hering, (Wed Jan 23, 3:58 am)
Re: crash in kmem_cache_init, Mel Gorman, (Wed Jan 23, 6:50 am)
Re: crash in kmem_cache_init, Olaf Hering, (Wed Jan 23, 8:14 am)
Re: crash in kmem_cache_init, Mel Gorman, (Wed Jan 23, 9:41 am)
Re: crash in kmem_cache_init, Olaf Hering, (Wed Jan 23, 8:52 am)
[PATCH] Fix boot problem in situations where the boot CPU is..., Mel Gorman, (Wed Jan 23, 9:55 am)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Christoph Lameter, (Wed Jan 23, 2:41 pm)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Christoph Lameter, (Wed Jan 23, 2:35 pm)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Christoph Lameter, (Wed Jan 23, 2:36 pm)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Nishanth Aravamudan, (Wed Jan 23, 3:52 pm)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Christoph Lameter, (Wed Jan 23, 5:14 pm)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Nishanth Aravamudan, (Wed Jan 23, 5:36 pm)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Christoph Lameter, (Wed Jan 23, 11:13 pm)
Re: [PATCH] Fix boot problem in situations where the boot CP..., Christoph Lameter, (Wed Jan 23, 2:51 pm)
Re: crash in kmem_cache_init, Nish Aravamudan, (Tue Jan 22, 6:12 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Tue Jan 22, 4:11 pm)
Re: crash in kmem_cache_init, Mel Gorman, (Tue Jan 22, 5:26 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Tue Jan 22, 5:34 pm)
Re: crash in kmem_cache_init, Mel Gorman, (Tue Jan 22, 6:50 pm)
Re: crash in kmem_cache_init, Pekka Enberg, (Tue Jan 22, 6:59 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Tue Jan 22, 7:12 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Tue Jan 22, 7:18 pm)
Re: crash in kmem_cache_init, Pekka Enberg, (Wed Jan 23, 4:19 am)
Re: crash in kmem_cache_init, Olaf Hering, (Wed Jan 23, 4:40 am)
Re: crash in kmem_cache_init, Christoph Lameter, (Tue Jan 22, 6:57 pm)
Re: crash in kmem_cache_init, Mel Gorman, (Tue Jan 22, 7:10 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Tue Jan 22, 7:14 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Fri Jan 18, 6:38 pm)
Re: crash in kmem_cache_init, Nish Aravamudan, (Fri Jan 18, 6:19 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Fri Jan 18, 5:43 pm)
Re: crash in kmem_cache_init, Olaf Hering, (Fri Jan 18, 2:56 am)
Re: crash in kmem_cache_init, Christoph Lameter, (Sat Jan 19, 12:55 am)
Re: crash in kmem_cache_init, Christoph Lameter, (Fri Jan 18, 2:42 pm)
Re: crash in kmem_cache_init, Olaf Hering, (Thu Jan 17, 3:54 pm)
Re: crash in kmem_cache_init, Olaf Hering, (Thu Jan 17, 4:20 pm)
Re: crash in kmem_cache_init, Christoph Lameter, (Sat Jan 19, 12:56 am)
Re: crash in kmem_cache_init, Olaf Hering, (Tue Jan 15, 11:58 am)