mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Anton Blanchard <anton@samba.org>,
	akpm@osdl.org, linuxppc-dev@ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: kernel BUG in __cache_alloc_node at linux-2.6.git/mm/slab.c:3177!
Date: Fri, 20 Oct 2006 17:18:44 +1000	[thread overview]
Message-ID: <17720.30804.180390.197567@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0610191527040.10880@schroedinger.engr.sgi.com>

Christoph Lameter writes:

> The page allocator must be running and able to serve pages from the boot 
> node. This fails for some reason and the slab cannot bootstrap. The memory 
> not available is the first guess. Could you trace the allocation in the 
> page allocator (__alloc_pages) when the slab attempts to bootstrap and 
> figure out why exactly the allocation fails?

What is happening is that all pages are getting their zone id field in
their page->flags set to point to zone for node 1 by memmap_init_zone
calling set_page_links (which does set_page_zone).  Thus, when those
pages get freed by free_all_bootmem_node, they all end up in the zone
for node 1.

memmap_init_zone is called (as memmap_init, since we don't have
__HAVE_ARCH_MEMMAP_INIT defined) from init_currently_empty_zone, which
is called from free_area_init_core.  Now the thing is that memmap_init
and init_currently_empty_zone are called with the node's start PFN and
size in pages, *including* holes.  On the partition I'm using we have
these PFN ranges for the nodes:

    1:        0 ->    32768
    0:    32768 ->   278528
    1:   278528 ->   524288

So node 0's start PFN is 32768 and its size is 245760 pages, and so we
correctly set pages 32786 to 278527 to be in the zone for node 0.
Then for node 1, we have the start PFN is 0 and the size is 524288, so
we then go through and set *all* pages of memory to be in the zone for
node 1, including the pages which are actually on node 0.

That's why we can't allocate any pages on node 0, and the kmem cache
bootstrapping blows up.

I don't know this code well enough to know what the correct fix is.
Clearly memmap_init_zone should only be touching the pages that are
actually present in the zone, but I don't know exactly what data
structures it should be using to know what those pages are.

Paul.


  reply	other threads:[~2006-10-20  7:18 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-13 18:41 Will Schmidt
2006-10-13 19:05 ` Christoph Lameter
2006-10-13 19:53   ` Will Schmidt
2006-10-13 20:57     ` Will Schmidt
2006-10-13 21:22       ` Nathan Lynch
2006-10-13 21:34         ` Anton Blanchard
2006-10-13 22:01         ` Mike Kravetz
2006-10-13 22:22       ` Christoph Lameter
2006-10-16 16:00         ` Will Schmidt
2006-10-16 19:20         ` Will Schmidt
2006-10-16 19:25           ` Christoph Lameter
2006-10-16 20:50             ` Will Schmidt
2006-10-16 23:37               ` Christoph Lameter
2006-10-18  6:11                 ` Paul Mackerras
2006-10-18 15:12                   ` Christoph Lameter
2006-10-18 21:19                     ` Paul Mackerras
2006-10-18 21:26                       ` Christoph Lameter
2006-10-18 21:49                       ` Christoph Lameter
2006-10-19  5:03                         ` Paul Mackerras
2006-10-19 16:16                           ` Christoph Lameter
2006-10-19 16:30                             ` Anton Blanchard
2006-10-19 16:49                               ` Christoph Lameter
2006-10-19 22:23                                 ` Paul Mackerras
2006-10-19 22:31                                   ` Christoph Lameter
2006-10-20  7:18                                     ` Paul Mackerras [this message]
2006-10-20 14:18                                       ` Andy Whitcroft
2006-10-20 14:31                                         ` [PATCH] Reintroduce NODES_SPAN_OTHER_NODES for powerpc Andy Whitcroft
2006-10-20 16:30                                           ` Mel Gorman
2006-10-20 14:59                                         ` kernel BUG in __cache_alloc_node at linux-2.6.git/mm/slab.c:3177! Mike Kravetz
2006-10-20 15:19                                         ` Will Schmidt
2006-10-20 16:00                                         ` Andy Whitcroft
2006-10-20 17:09                                           ` Andrew Morton
2006-10-20 17:46                                             ` Christoph Lameter
2006-10-20 18:07                                               ` Andy Whitcroft
2006-10-20 17:13                                           ` Will Schmidt
2006-10-20 17:34                                       ` Christoph Lameter
2006-10-20 22:54                                         ` Paul Mackerras
2006-10-19 17:03                               ` Christoph Lameter
2006-10-19 18:07                                 ` Christoph Lameter
2006-10-19 20:37                                 ` Will Schmidt
2006-10-19 21:28                                   ` Christoph Lameter
2006-10-19 21:43                                     ` Will Schmidt
2006-10-19 22:00                                       ` Christoph Lameter
2006-10-19 21:39                                   ` Christoph Lameter
2006-10-19 20:38                             ` Will Schmidt
2006-10-19 21:30                               ` Christoph Lameter
2006-10-18 16:06                   ` 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=17720.30804.180390.197567@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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

all inboxes | Powered by JetHome®