Re: [PATCH] x86: endless page faults in mount_block_root for Linux2.6

From: Ingo Molnar
Date: Tue Apr 29 2008 - 18:25:31 EST



* Pekka Enberg <penberg@xxxxxxxxxxxxxx> wrote:

> On Tue, Apr 29, 2008 at 5:33 PM, Ingo Molnar <mingo@xxxxxxx> wrote:
> > btw., i have a kmemcheck-reported bug fixed in this same area with the
> > patch below. I dont remember the details anymore, but the root mount
> > code did something really, really weird here.
> >
> > Subject: init: root mount fix
> > From: Ingo Molnar <mingo@xxxxxxx>
> > Date: Tue Apr 29 16:31:50 CEST 2008
> >
> > Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
> > ---
> > init/do_mounts.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > Index: linux/init/do_mounts.c
> > ===================================================================
> > --- linux.orig/init/do_mounts.c
> > +++ linux/init/do_mounts.c
> > @@ -201,9 +201,13 @@ static int __init do_mount_root(char *na
> > return 0;
> > }
> >
> > +#if PAGE_SIZE < PATH_MAX
> > +# error increase the fs_names allocation size here
> > +#endif
> >
> > +
> > void __init mount_block_root(char *name, int flags)
> > {
> > - char *fs_names = __getname();
> > + char *fs_names = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
> >
> > char *p;
> > #ifdef CONFIG_BLOCK
> > char b[BDEVNAME_SIZE];
> > @@ -251,7 +255,7 @@ retry:
> >
> > #endif
> > panic("VFS: Unable to mount root fs on %s", b);
> > out:
> > - putname(fs_names);
> > + free_pages((unsigned long)fs_names, 1);
> > }
> >
> > #ifdef CONFIG_ROOT_NFS
>
> It could have been a bug in early kmemcheck too. We don't check memory
> allocated with the page allocator, only slab, so this shouldn't
> trigger anything.

no, i tracked it down and the problem was some genuine weirdness in this
code (and not in kmemcheck) but i forgot the details :-)

it was something rather disgusting, the boot parameter parsing stuff.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/