linux-kernel-test/arch/x86/mm
Ingo Molnar 509a80c49c x86: fix CONFIG_PAGEALLOC related boot hangs/OOMs
if CONFIG_PAGEALLOC is enabled then X86_FEATURE_PSE is disabled and all
the kernel physical RAM pagetables are set up as 4K pages. This is
needed so that CONFIG_PAGEALLOC can do finegrained mapping and unmapping
of pages.

as a side-effect though, the total size of memory allocated as kernel
pagetables increases significantly. All these pagetables are allocated
via alloc_bootmem_low_pages(), straight out of the lowmem DMA pool. If
the system has enough RAM and a large kernel image then almost all of
the 16 MB lowmem DMA pool is allocated to the image and to pagetables -
leaving no space for __GFP_DMA allocations.

this results in drivers failing and the bootup hanging:

 swapper invoked oom-killer: gfp_mask=0x80d1, order=0, oomkilladj=0
  [<4015059f>] out_of_memory+0x17f/0x1c0
  [<40151f3c>] __alloc_pages+0x37c/0x3a0
  [<40168cd7>] slob_new_page+0x37/0x50
  [<40168dff>] slob_alloc+0x10f/0x190
  [<40169010>] __kmalloc_node+0x80/0x90
  [<405a17e3>] scsi_host_alloc+0x33/0x2c0
  [<405a1a82>] scsi_register+0x12/0x60
  [<40d5889e>] aha1542_detect+0x9e/0x940
  [<405c5ba5>] ultrastor_detect+0x265/0x5f0
  [<401352f5>] getnstimeofday+0x35/0xf0
  [<40d58751>] init_this_scsi_driver+0x41/0xf0
  [<40d0b856>] kernel_init+0x136/0x310
  [<40d58710>] init_this_scsi_driver+0x0/0xf0
  [<40d0b720>] kernel_init+0x0/0x310
  [<40105547>] kernel_thread_helper+0x7/0x10
  =======================

the fix is to first allocate from above the DMA pool, and if that fails
(for example due to it being a machine with less than 16 MB of RAM),
allocate from the DMA pool as a fallback.

With this fix applied i was able to boot a PAGEALLOC=y kernel that would
hang before.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2007-10-17 20:15:39 +02:00
..
boot_ioremap_32.c
discontig_32.c [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
extable_32.c
extable_64.c x86_64: move mm 2007-10-11 11:17:18 +02:00
fault_32.c During VM oom condition, kill all threads in process group 2007-10-16 09:42:52 -07:00
fault_64.c x86: optimize page faults like all other achitectures and kill notifier cruft 2007-10-16 09:42:50 -07:00
highmem_32.c
hugetlbpage.c
init_32.c x86: fix CONFIG_PAGEALLOC related boot hangs/OOMs 2007-10-17 20:15:39 +02:00
init_64.c fix memory hot remove not configured case. 2007-10-16 09:43:02 -07:00
ioremap_32.c
ioremap_64.c x86_64: move mm 2007-10-11 11:17:18 +02:00
k8topology_64.c x86_64: move mm 2007-10-11 11:17:18 +02:00
Makefile x86_64: move mm 2007-10-11 11:17:18 +02:00
Makefile_32
Makefile_64 x86_64: move mm 2007-10-11 11:17:18 +02:00
mmap_32.c
mmap_64.c x86_64: move mm 2007-10-11 11:17:18 +02:00
numa_64.c x86_64: move mm 2007-10-11 11:17:18 +02:00
pageattr_32.c
pageattr_64.c x86_64: move mm 2007-10-11 11:17:18 +02:00
pgtable_32.c i386: avoid temporarily inconsistent pte-s 2007-10-17 20:15:28 +02:00
srat_64.c x86_64: move mm 2007-10-11 11:17:18 +02:00