linux/arch
Srikar Dronamraju 1e76609cc1 powerpc: implement arch_reserved_kernel_pages
Currently significant amount of memory is reserved only in kernel booted
to capture kernel dump using the fa_dump method.

Kernels compiled with CONFIG_DEFERRED_STRUCT_PAGE_INIT will initialize
only certain size memory per node.  The certain size takes into account
the dentry and inode cache sizes.  Currently the cache sizes are
calculated based on the total system memory including the reserved
memory.  However such a kernel when booting the same kernel as fadump
kernel will not be able to allocate the required amount of memory to
suffice for the dentry and inode caches.  This results in crashes like

Hence only implement arch_reserved_kernel_pages() for CONFIG_FA_DUMP
configurations.  The amount reserved will be reduced while calculating
the large caches and will avoid crashes like the below on large systems
such as 32 TB systems.

  Dentry cache hash table entries: 536870912 (order: 16, 4294967296 bytes)
  vmalloc: allocation failure, allocated 4097114112 of 17179934720 bytes
  swapper/0: page allocation failure: order:0, mode:0x2080020(GFP_ATOMIC)
  CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.6-master+ #3
  Call Trace:
     dump_stack+0xb0/0xf0 (unreliable)
     warn_alloc_failed+0x114/0x160
     __vmalloc_node_range+0x304/0x340
     __vmalloc+0x6c/0x90
     alloc_large_system_hash+0x1b8/0x2c0
     inode_init+0x94/0xe4
     vfs_caches_init+0x8c/0x13c
     start_kernel+0x50c/0x578
     start_here_common+0x20/0xa8

Link: http://lkml.kernel.org/r/1472476010-4709-4-git-send-email-srikar@linux.vnet.ibm.com
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Suggested-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-07 18:46:28 -07:00
..
alpha alpha: fix copy_from_user() 2016-09-09 19:34:32 -04:00
arc PCI changes for the v4.9 merge window: 2016-10-07 11:46:37 -07:00
arm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2016-10-07 09:12:19 -07:00
arm64 KVM updates for v4.9-rc1 2016-10-06 10:49:01 -07:00
avr32 avr32: fix 'undefined reference to `___copy_from_user' 2016-09-18 07:26:26 -07:00
blackfin This is the bulk of GPIO changes for the v4.9 series: 2016-10-05 11:49:09 -07:00
c6x dma-mapping: use unsigned long for dma_attrs 2016-08-04 08:50:07 -04:00
cris cris: buggered copy_from_user/copy_to_user/clear_user 2016-09-13 17:49:38 -04:00
frv frv: fix clear_user() 2016-09-13 17:49:39 -04:00
h8300 h8300: Add missing include file to asm/io.h 2016-08-13 08:53:56 -07:00
hexagon hexagon: fix strncpy_from_user() error return 2016-09-13 17:49:39 -04:00
ia64 Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-10-03 19:43:08 -07:00
m32r m32r: fix __get_user() 2016-09-13 17:50:16 -04:00
m68k Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2016-10-05 18:18:20 -07:00
metag metag: copy_from_user() should zero the destination on access_ok() failure 2016-09-13 17:49:40 -04:00
microblaze PCI changes for the v4.9 merge window: 2016-10-07 11:46:37 -07:00
mips KVM updates for v4.9-rc1 2016-10-06 10:49:01 -07:00
mn10300 mn10300: copy_from_user() should zero on access_ok() failure... 2016-09-13 17:49:42 -04:00
nios2 TTY/Serial patches for 4.9-rc1 2016-10-03 20:11:49 -07:00
openrisc openrisc: fix the fix of copy_from_user() 2016-09-18 07:26:42 -07:00
parisc Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00
powerpc powerpc: implement arch_reserved_kernel_pages 2016-10-07 18:46:28 -07:00
s390 KVM updates for v4.9-rc1 2016-10-06 10:49:01 -07:00
score score: fix copy_from_user() and friends 2016-09-13 17:50:14 -04:00
sh This release cycle is rather small. Just a few fixes to tracing. 2016-10-06 11:48:41 -07:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2016-10-06 08:12:08 -07:00
tile Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00
um Char/Misc driver update for 4.9-rc1 2016-10-03 19:57:49 -07:00
unicore32 unicore32: mm: Add missing parameter to arch_vma_access_permitted 2016-08-13 08:53:18 -07:00
x86 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2016-10-07 12:24:08 -07:00
xtensa Xtensa improvements for 4.9: 2016-10-05 17:44:48 -07:00
.gitignore
Kconfig Merge branch 'linus' into x86/asm, to pick up recent fixes 2016-09-15 08:24:53 +02:00