linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linuxppc-dev@ozlabs.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	john stultz <johnstul@us.ibm.com>
Subject: Re: Make sure we populate the initroot filesystem late enough
Date: Mon, 26 Feb 2007 11:24:57 -0500	[thread overview]
Message-ID: <1172507097.3971.62.camel@shinybook.infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0702252009110.12485@woody.linux-foundation.org>

On Sun, 2007-02-25 at 20:13 -0800, Linus Torvalds wrote:
> 
> On Sun, 25 Feb 2007, David Woodhouse wrote:
> >
> > > Can you try adding something like
> > > 
> > >         memset(start, 0xf0, end - start);
> > 
> > Yeah, I did that before giving up on it for the day and going in search
> > of dinner. It changes the failure mode to a BUG() in
> > cache_free_debugcheck(), at line 2876 of mm/slab.c
>
> Ok, that's just strange. 

In this case I hadn't left the 'return' in free_initrd_mem(). I was
poisoning the pages and then returning them to the pool as usual.

If I poison the pages and _don't_ return them to the pool, it boots
fine. PageReserved is set on every page in the initrd region; total
page_count() is equal to the number of pages (which doesn't
_necessarily_ mean that page_count() for every page is equal to 1 but
it's a strong hint that that's the case).

Looking in /dev/mem after it boots, I see that my poison is still
present throughout the whole region.

> One obvious thing to do would be to remove all the "__initdata" entries in 
> mm/slab.c..

This is biting us long before we call free_initmem().

>  But I'd also like to see the full backtrace for the  BUG_ON(), 
> in case that gives any clues at all.

I'll see if I can find a camera. 

> > It smells like the pages weren't actually reserved in the first place
> > and we were blithely allocating them. The only problem with that theory
> > is that the initrd doesn't seem to be getting corrupted -- and if we
> > were handing out its pages like that then surely _something_ would have
> > scribbled on it before we tried to read it.
> 
> Yeah, I don't think it's necessarily initrd itself, I'd be more inclined 
> to think that the reason you see this change with the initrd unpacking is 
> simply that it does a lot of allocations for the initrd files, so I think 
> it is only indirectly involved - just because it ends up being a slab 
> user.

Whatever happens, initrd as a 'slab user' is fine. The crashes happen
_later_, when someone else is using the memory which used to belong to
the initrd. In that 'BUG at slab.c:2876' I mentioned above, r3 was
within the initrd region. As I said, I'll try to find a camera.

-- 
dwmw2

  reply	other threads:[~2007-02-26 16:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200612112059.kBBKx1j7022473@hera.kernel.org>
2007-02-26  0:00 ` Make sure we populate the initroot filesystem late enough David Woodhouse
2007-02-26  0:24   ` Linus Torvalds
2007-02-26  0:45     ` David Woodhouse
2007-02-26  1:17     ` David Woodhouse
2007-02-26  3:45       ` Linus Torvalds
2007-02-26  4:01         ` David Woodhouse
2007-02-26  4:13           ` Linus Torvalds
2007-02-26 16:24             ` David Woodhouse [this message]
2007-02-26  6:59           ` William Lee Irwin III
2007-02-26 15:53           ` Benjamin Herrenschmidt
2007-02-26 16:00             ` Segher Boessenkool
2007-02-26 16:44           ` Milton Miller
2007-02-26 20:57             ` David Woodhouse
2007-02-26 21:17               ` Linus Torvalds
2007-02-27  6:46                 ` Benjamin Herrenschmidt
2007-02-26 15:51       ` Benjamin Herrenschmidt
2007-02-26 20:51         ` Kumar Gala
2007-02-26 19:27   ` john stultz
2007-02-26 22:27     ` Paul TBBle Hampson
2007-02-27  6:48       ` Benjamin Herrenschmidt
2007-02-27 11:58         ` Segher Boessenkool
2007-02-28  6:43           ` Benjamin Herrenschmidt
2007-02-28 10:13             ` David Woodhouse
2007-03-01  0:30               ` Michael Ellerman
2007-03-12 23:01                 ` Paul TBBle Hampson
2007-03-13  3:03                   ` Kumar Gala
2007-03-13  7:03                   ` Benjamin Herrenschmidt
2007-03-16  7:20                     ` Paul TBBle Hampson

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=1172507097.3971.62.camel@shinybook.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).