diff options
| author | John W. Linville <linville@tuxdriver.com> | 2006-05-05 16:50:23 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2006-05-05 16:50:23 -0400 |
| commit | aad61439e6a00bdb72cb649e11f6e166590c5f66 (patch) | |
| tree | 2279f3c2a15f81526d14182c6acb358cafd0b359 /mm/sparse.c | |
| parent | 3c304956755fa63ee80ca51ce38078fe1c4e8818 (diff) | |
| parent | d98550e334715b2d9e45f8f0f4e1608720108640 (diff) | |
Merge branch 'from-linus' into upstream
Diffstat (limited to 'mm/sparse.c')
| -rw-r--r-- | mm/sparse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/sparse.c b/mm/sparse.c index 0a51f36ba3a1..d7c32de99ee8 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -32,7 +32,10 @@ static struct mem_section *sparse_index_alloc(int nid) unsigned long array_size = SECTIONS_PER_ROOT * sizeof(struct mem_section); - section = alloc_bootmem_node(NODE_DATA(nid), array_size); + if (system_state == SYSTEM_RUNNING) + section = kmalloc_node(array_size, GFP_KERNEL, nid); + else + section = alloc_bootmem_node(NODE_DATA(nid), array_size); if (section) memset(section, 0, array_size); @@ -281,9 +284,9 @@ int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, ret = sparse_init_one_section(ms, section_nr, memmap); - if (ret <= 0) - __kfree_section_memmap(memmap, nr_pages); out: pgdat_resize_unlock(pgdat, &flags); + if (ret <= 0) + __kfree_section_memmap(memmap, nr_pages); return ret; } |
