android_kernel_xiaomi_sm8350/mm
Mel Gorman ba72cb8cb0 Fix boot problem with iSeries lacking hugepage support
Ordinarily the size of a pageblock is determined at compile-time based on the
hugepage size. On PPC64, the hugepage size is determined at runtime based on
what is supported by the machine. With legacy machines such as iSeries that
do not support hugepages, HPAGE_SHIFT is 0. This results in pageblock_order
being set to -PAGE_SHIFT and a crash results shortly afterwards.

This patch adds a function to select a sensible value for pageblock order by
default when HUGETLB_PAGE_SIZE_VARIABLE is set. It checks that HPAGE_SHIFT
is a sensible value before using the hugepage size; if it is not MAX_ORDER-1
is used.

This is a fix for 2.6.24.

Credit goes to Stephen Rothwell for identifying the bug and testing candidate
patches.  Additional credit goes to Andy Whitcroft for spotting a problem
with respects to IA-64 before releasing. Additional credit to David Gibson
for testing with the libhugetlbfs test suite.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-29 09:24:51 -08:00
..
allocpercpu.c
backing-dev.c
bootmem.c
bounce.c
fadvise.c
filemap_xip.c
filemap.c Remove broken ptrace() special-case code from file mapping 2007-10-31 09:19:46 -07:00
fremap.c
highmem.c
hugetlb.c hugetlb: fix i_blocks accounting 2007-11-14 18:45:40 -08:00
internal.h
Kconfig
madvise.c
Makefile
memory_hotplug.c Add IORESOUCE_BUSY flag for System RAM 2007-11-14 18:45:39 -08:00
memory.c Swap delay accounting, include lock_page() delays 2007-11-14 18:45:44 -08:00
mempolicy.c Migration: find correct vma in new_vma_page() 2007-11-14 18:45:38 -08:00
mempool.c
migrate.c
mincore.c
mlock.c
mmap.c fix mprotect vma_wants_writenotify prot 2007-10-23 08:32:06 -07:00
mmzone.c
mprotect.c fix mprotect vma_wants_writenotify prot 2007-10-23 08:32:06 -07:00
mremap.c
msync.c
nommu.c NOMMU: mm/nommu.c needs linux/module.h 2007-10-29 07:53:26 -07:00
oom_kill.c
page_alloc.c Fix boot problem with iSeries lacking hugepage support 2007-11-29 09:24:51 -08:00
page_io.c
page_isolation.c memory hotremove: unset migrate type "ISOLATE" after removal 2007-11-14 18:45:38 -08:00
page-writeback.c dirty page balancing: Get rid of broken unmapped_ratio logic 2007-11-15 16:41:52 -08:00
pdflush.c
prio_tree.c
quicklist.c
readahead.c
rmap.c [S390] Optimize storage key handling for anonymous pages 2007-11-20 11:13:46 +01:00
shmem_acl.c
shmem.c tmpfs: restore missing clear_highpage 2007-11-28 11:04:28 -08:00
slab.c slab: fix typo in allocation failure handling 2007-11-14 18:45:36 -08:00
slob.c slob: fix memory corruption 2007-11-15 08:36:27 -08:00
slub.c SLUB: killed the unused "end" variable 2007-11-12 10:32:29 -08:00
sparse-vmemmap.c mm/sparse-vmemmap.c: make sure init_mm is included 2007-10-30 08:06:55 -07:00
sparse.c Revert "x86_64: allocate sparsemem memmap above 4G" 2007-10-29 14:05:37 -07:00
swap_state.c
swap.c
swapfile.c
thrash.c
tiny-shmem.c
truncate.c
util.c fix mm/util.c:krealloc() 2007-11-14 18:45:41 -08:00
vmalloc.c
vmscan.c
vmstat.c vmstat: fix section mismatch warning 2007-11-14 18:45:42 -08:00