linux/Documentation/powerpc
Mahesh Salgaonkar a4e92ce8e4 powerpc/fadump: Reservationless firmware assisted dump
One of the primary issues with Firmware Assisted Dump (fadump) on Power
is that it needs a large amount of memory to be reserved. On large
systems with TeraBytes of memory, this reservation can be quite
significant.

In some cases, fadump fails if the memory reserved is insufficient, or
if the reserved memory was DLPAR hot-removed.

In the normal case, post reboot, the preserved memory is filtered to
extract only relevant areas of interest using the makedumpfile tool.
While the tool provides flexibility to determine what needs to be part
of the dump and what memory to filter out, all supported distributions
default this to "Capture only kernel data and nothing else".

We take advantage of this default and the Linux kernel's Contiguous
Memory Allocator (CMA) to fundamentally change the memory reservation
model for fadump.

Instead of setting aside a significant chunk of memory nobody can use,
this patch uses CMA instead, to reserve a significant chunk of memory
that the kernel is prevented from using (due to MIGRATE_CMA), but
applications are free to use it. With this fadump will still be able
to capture all of the kernel memory and most of the user space memory
except the user pages that were present in CMA region.

Essentially, on a P9 LPAR with 2 cores, 8GB RAM and current upstream:
[root@zzxx-yy10 ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           7557         193        6822          12         541        6725
Swap:          4095           0        4095

With this patch:
[root@zzxx-yy10 ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           8133         194        7464          12         475        7338
Swap:          4095           0        4095

Changes made here are completely transparent to how fadump has
traditionally worked.

Thanks to Aneesh Kumar and Anshuman Khandual for helping us understand
CMA and its usage.

TODO:
- Handle case where CMA reservation spans nodes.

Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-12-21 11:32:49 +11:00
..
bootwrapper.txt
cpu_families.txt
cpu_features.txt
cxl.txt cxl: Add psl9 specific code 2017-04-13 23:34:31 +10:00
cxlflash.txt scsi: cxlflash: Support AFU debug 2017-06-26 15:01:12 -04:00
DAWR-POWER9.txt powerpc: Document issues with the DAWR on POWER9 2018-07-02 23:54:28 +10:00
dscr.txt
eeh-pci-error-recovery.txt
firmware-assisted-dump.txt powerpc/fadump: Reservationless firmware assisted dump 2018-12-21 11:32:49 +11:00
hvcs.txt
isa-versions.rst powerpc: Add some documentation of ISA versions 2018-12-20 22:21:20 +11:00
mpc52xx.txt
pci_iov_resource_on_powernv.txt
pmu-ebb.txt
ptrace.txt
qe_firmware.txt
syscall64-abi.txt powerpc/64: Document the syscall ABI 2016-09-20 14:36:14 +10:00
transactional_memory.txt powerpc: Document issues with TM on POWER9 2018-07-02 23:54:29 +10:00