android_kernel_xiaomi_sdm845/arch/x86
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 [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
crypto x86_64: move crypto 2007-10-11 11:17:03 +02:00
ia32 x86_64: Fix compat emulation of PTRACE_GET/SET_THREAD_AREA 2007-10-17 20:15:34 +02:00
kernel x86: prepare page allocator for high allocations on PAGEALLOC=y 2007-10-17 20:15:38 +02:00
lib x86: fix off-by-one in find_next_zero_string 2007-10-17 20:15:22 +02:00
mach-default [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
mach-es7000 i386: move mach-es7000 2007-10-11 11:16:50 +02:00
mach-generic Merge branch 'dmi-const' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6 2007-10-11 19:18:45 -07:00
mach-visws [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
mach-voyager [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00
math-emu kbuild: fix up CFLAGS usage 2007-10-14 21:49:42 +02:00
mm x86: fix CONFIG_PAGEALLOC related boot hangs/OOMs 2007-10-17 20:15:39 +02:00
oprofile i386: make Oprofile call shutdown() only once per session 2007-10-17 20:15:14 +02:00
pci Merge branch 'dmi-const' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6 2007-10-11 19:18:45 -07:00
power i386: move power 2007-10-11 11:16:34 +02:00
vdso x86: Install unstripped copy of 64bit vdso to disk 2007-10-17 20:15:20 +02:00
video i386: move video 2007-10-11 11:16:56 +02:00
xen [x86] remove uses of magic macros for boot_params access 2007-10-16 17:38:31 -07:00