On 5/18/21 5:04 PM, Kairui Song wrote:
Patch 1, 2 add a helper to detect and list crypt devices.
Patch 3 simplify some existing code with the helper.
Patch 4 adds kdumpctl estimate command and updates man page.
Following contents are copied from Patch 4:
Add a rough esitimation support, currently, following memory usage are
checked by this sub command:
- System RAM
- Kdump Initramfs size
- Kdump Kernel image size
- Kdump Kernel module size
- Kdump userspace user and other runtime allocated memory (currently
simply using a fixed value: 64M)
- LUKS encryption memory usage
The output of kdumpctl estimate looks like this:
# kdumpctl estimate
Reserved crashkernel: 256M
Recommanded crashkernel: 160M
Kernel image size: 47M
Kernel modules size: 12M
Initramfs size: 19M
Runtime reservation: 64M
Large modules:
xfs: 1892352
nouveau: 2318336
And if the kdump target is encrypted:
# kdumpctl estimate
Encrypted kdump target requires extra memory, assuming using the keyslot with minimun
memory requirement
Reserved crashkernel: 256M
Recommanded crashkernel: 655M
Kernel image size: 47M
Kernel modules size: 12M
Initramfs size: 19M
Runtime reservation: 64M
LUKS required size: 512M
Large modules:
xfs: 1892352
nouveau: 2318336
WARNING: Current crashkernel size is lower than recommanded size 655M.
The "Recommanded" value is calculated based on memory usages mentioned
above, and will be adjusted accodingly to be no less than the value provided
by kdump_get_arch_recommend_size.
--
Update from v3:
- Simplify the code, and rebase.
- Also simpify the output to make it easier to understand.
Update from v2:
- If binutils or kernel decompression tools are not installed, will
get kernel size from iomem.
- Add support for detecting LUKS memory requirement.
Update from v1:
- Fix typos
- Remove "Baseline crashkernel:" from output
Kairui Song (4):
kdump-lib.sh: introduce a helper to get underlying crypt device
kdump-lib.sh: introduce a helper to get all crypt dev used by kdump
mkdumprd: make use of the new get_luks_crypt_dev helper
kdumpctl: Add kdumpctl estimate
kdump-lib.sh | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++
kdumpctl | 96 ++++++++++++++++++++++++++++++++++++++++++++-
kdumpctl.8 | 7 ++++
mkdumprd | 32 +++------------
4 files changed, 217 insertions(+), 27 deletions(-)
For the series,
Acked-by: Pingfan Liu <piliu(a)redhat.com>