linux/mm
Paul Mundt d09c6b8094 mm: Fix memory/cpu hotplug section mismatch and oops.
When building with memory hotplug enabled and cpu hotplug disabled, we
end up with the following section mismatch:

WARNING: mm/built-in.o(.text+0x4e58): Section mismatch: reference to
.init.text: (between 'free_area_init_node' and '__build_all_zonelists')

This happens as a result of:

        -> free_area_init_node()
          -> free_area_init_core()
            -> zone_pcp_init() <-- all __meminit up to this point
              -> zone_batchsize() <-- marked as __cpuinit                     fo

This happens because CONFIG_HOTPLUG_CPU=n sets __cpuinit to __init, but
CONFIG_MEMORY_HOTPLUG=y unsets __meminit.

Changing zone_batchsize() to __devinit fixes this.

__devinit is the only thing that is common between CONFIG_HOTPLUG_CPU=y and
CONFIG_MEMORY_HOTPLUG=y. In the long run, perhaps this should be moved to
another section identifier completely. Without this, memory hot-add
of offline nodes (via hotadd_new_pgdat()) will oops if CPU hotplug is
not also enabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

--

 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
2007-06-15 16:18:08 -07:00
..
Kconfig sh64: generic quicklist support. 2007-05-14 09:55:35 +09:00
Makefile Quicklists for page table pages 2007-05-07 12:12:54 -07:00
allocpercpu.c
backing-dev.c
bootmem.c
bounce.c
fadvise.c
filemap.c Fix: find_or_create_page skips cpuset memory spreading. 2007-05-16 21:19:15 -07:00
filemap.h
filemap_xip.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
fremap.c
highmem.c [PATCH] i386: PARAVIRT: add kmap_atomic_pte for mapping highpte pages 2007-05-02 19:27:15 +02:00
hugetlb.c pretend cpuset has some form of hugetlb page reservation 2007-05-09 12:30:49 -07:00
internal.h Make page->private usable in compound pages 2007-05-07 12:12:53 -07:00
madvise.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
memory.c mm: more rmap checking 2007-05-17 05:23:06 -07:00
memory_hotplug.c memory hotplug: fix unnecessary calling of init_currenty_empty_zone() 2007-06-01 08:18:29 -07:00
mempolicy.c
mempool.c
migrate.c page migration: fix NR_FILE_PAGES accounting 2007-04-24 08:23:08 -07:00
mincore.c
mlock.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
mmap.c Fix occurrences of "the the " 2007-05-09 08:57:56 +02:00
mmzone.c
mprotect.c
mremap.c
msync.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
nommu.c move die notifier handling to common code 2007-05-08 11:15:04 -07:00
oom_kill.c oom: fix constraint deadlock 2007-05-07 12:12:55 -07:00
page-writeback.c consolidate generic_writepages and mpage_writepages 2007-05-11 08:29:35 -07:00
page_alloc.c mm: Fix memory/cpu hotplug section mismatch and oops. 2007-06-15 16:18:08 -07:00
page_io.c
pdflush.c
prio_tree.c
quicklist.c Quicklists for page table pages 2007-05-07 12:12:54 -07:00
readahead.c readahead: code cleanup 2007-05-07 12:12:52 -07:00
rmap.c mm: more rmap checking 2007-05-17 05:23:06 -07:00
shmem.c mount -t tmpfs -o mpol=: check nodes online 2007-06-08 17:23:32 -07:00
shmem_acl.c
slab.c slab: fix alien cache handling 2007-06-08 17:23:32 -07:00
slob.c Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
slub.c SLUB: return ZERO_SIZE_PTR for kmalloc(0) 2007-06-08 17:23:33 -07:00
sparse.c Move three functions that are only needed for CONFIG_MEMORY_HOTPLUG 2007-06-08 17:23:33 -07:00
swap.c Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
swap_state.c
swapfile.c mm: make read_cache_page synchronous 2007-05-07 12:12:51 -07:00
thrash.c Bug in mm/thrash.c function grab_swap_token() 2007-05-11 08:29:32 -07:00
tiny-shmem.c
truncate.c fs: convert core functions to zero_user_page 2007-05-09 12:30:55 -07:00
util.c
vmalloc.c Make __vunmap static 2007-05-17 05:23:04 -07:00
vmscan.c Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
vmstat.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00