Re: why can't we kmalloc in a __setup'd function?

Tigran Aivazian (tigran@sco.COM)
Fri, 19 Nov 1999 15:10:51 +0000 (GMT)


ok, never mind this question - I understand that we can gfp after
paging_init() but can only kmalloc() after kmem_cache_init(), so I can use
__get_free_page(GFP_KERNEL) or something like that in a __setup'd function
right?

Regards,
Tigran.

On Fri, 19 Nov 1999, Tigran Aivazian wrote:

> Hi,
>
> If using kmalloc() is too early for the function prepared by __setup() how
> is one supposed to allocate memory in there?
>
> I was thinking about implementing "rootfs=ext2" type of thing to optimize
> mount_root() and I don't like it walking through the list of all
> filesystems by default and trying to read_super on each. It is a good
> thing to do but not by default. By default it should use a boot parameter
> "rootfs=ext2" like we have in SVR4/SVR5. Imagine that Linux supports
> 1000 filesystems and some idiot linked them all into the static kernel
> - mounting root will be a bit slow :)
>
> But if I kmalloc() inside the "rootfs_setup" function prepared by
> __setup() I get "kmem_alloc() NULL ptr fron name=unknown" coming out of
> slab.
>
> Thanks,
> ------
> Tigran A. Aivazian | http://www.sco.com
> Escalations Research Group | tel: +44-(0)1923-813796
> Santa Cruz Operation Ltd | http://www.ocston.org/~tigran
>
>
>

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