Staging
v0.5.1
https://github.com/torvalds/linux
Revision cd94b9dbfa300fc42e45f230010623fc08d59563 authored by Heiko Carstens on 23 May 2008, 20:04:52 UTC, committed by Linus Torvalds on 24 May 2008, 16:56:12 UTC
Trying to add memory via add_memory() from within an initcall function
results in

bootmem alloc of 163840 bytes failed!
Kernel panic - not syncing: Out of memory

This is caused by zone_wait_table_init() which uses system_state to decide
if it should use the bootmem allocator or not.

When initcalls are handled the system_state is still SYSTEM_BOOTING but
the bootmem allocator doesn't work anymore.  So the allocation will fail.

To fix this use slab_is_available() instead as indicator like we do it
everywhere else.

[akpm@linux-foundation.org: coding-style fix]
Reviewed-by: Andy Whitcroft <apw@shadowen.org>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7eb5482
Raw File
Tip revision: cd94b9dbfa300fc42e45f230010623fc08d59563 authored by Heiko Carstens on 23 May 2008, 20:04:52 UTC
memory hotplug: fix early allocation handling
Tip revision: cd94b9d
.gitignore
#
# NOTE! Don't add files that are generated in specific
# subdirectories here. Add them in the ".gitignore" file
# in that subdirectory instead.
#
# Normal rules
#
.*
*.o
*.o.*
*.a
*.s
*.ko
*.so
*.so.dbg
*.mod.c
*.i
*.lst
*.symtypes
*.order

#
# Top-level generic files
#
tags
TAGS
vmlinux*
!vmlinux.lds.S
System.map
Module.markers
Module.symvers
!.gitignore

#
# Generated include files
#
include/asm
include/asm-*/asm-offsets.h
include/config
include/linux/autoconf.h
include/linux/compile.h
include/linux/version.h
include/linux/utsrelease.h
include/linux/bounds.h

# stgit generated dirs
patches-*

# quilt's files
patches
series

# cscope files
cscope.*

*.orig
*~
\#*#
back to top