Skip to content

Commit 77b80ce

Browse files
hbathinicoiby
authored andcommitted
fadump: pass additional parameters for capture kernel
Since kernel commit 3416c9daa6b13 ("powerpc/fadump: pass additional parameters when fadump is active"), fadump supports passing additional parameters to dump capture kernel. Leverage that support here to pass additional parameters to dump capture kernel. Also, update fadump-howto.txt to make clear on the options that are not relevant for fadump in /etc/sysconfig/kdump The default bootargs to append for fadump capture kernel boot are chosen with the intent to optimize resources and reduce memory footprint in dump capture environment. Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
1 parent ca6da9b commit 77b80ce

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

fadump-howto.txt

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,27 @@ Advanced Setups & Failure action:
319319
Kdump and fadump exhibit similar behavior in terms of setup & failure action.
320320
For fadump advanced setup related information see section "Advanced Setups" in
321321
"kexec-kdump-howto.txt" document. Refer to "Failure action" section in "kexec-
322-
kdump-howto.txt" document for fadump failure action related information.
322+
kdump-howto.txt" document for fadump failure action related information. Note
323+
that the below options from /etc/sysconfig/kdump have no relevance to fadump
324+
owing to the way it operates:
325+
326+
-KDUMP_BOOTDIR
327+
-KDUMP_IMG
328+
-KDUMP_IMG_EXT
329+
-KEXEC_ARGS
330+
-KDUMP_KERNELVER
331+
-KDUMP_COMMANDLINE
332+
-KDUMP_COMMANDLINE_REMOVE
333+
-KDUMP_COMMANDLINE_APPEND
334+
335+
Passing additional parameters to fadump capture kerenl
336+
337+
-FADUMP_COMMANDLINE_APPEND
338+
339+
If a powerpc system supports passing additional parameters, it would have the
340+
sysfs node '/sys/kernel/fadump/bootargs_append'. FADUMP_COMMANDLINE_APPEND
341+
allows us to append arguments to fadump capture kernel, further to parameters
342+
passed via the bootloader.
323343

324344
Compression and filtering
325345

@@ -331,11 +351,7 @@ Notes on rootfs mount:
331351
Dracut is designed to mount rootfs by default. If rootfs mounting fails it
332352
will refuse to go on. So fadump leaves rootfs mounting to dracut currently.
333353
We make the assumtion that proper root= cmdline is being passed to dracut
334-
initramfs for the time being. If you need modify "KDUMP_COMMANDLINE=" in
335-
/etc/sysconfig/kdump, you will need to make sure that appropriate root=
336-
options are copied from /proc/cmdline. In general it is best to append
337-
command line options using "KDUMP_COMMANDLINE_APPEND=" instead of replacing
338-
the original command line completely.
354+
initramfs for the time being.
339355

340356
How to disable FADump:
341357

gen-kdump-sysconfig.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swio
3131
# after processed by KDUMP_COMMANDLINE_REMOVE
3232
KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 reset_devices novmcoredd cma=0 hugetlb_cma=0"
3333
34+
# This variable lets us append arguments to fadump (powerpc) capture kernel,
35+
# further to the parameters passed via the bootloader.
36+
FADUMP_COMMANDLINE_APPEND=""
37+
3438
# Any additional kexec arguments required. In most situations, this should
3539
# be left empty
3640
#
@@ -97,6 +101,8 @@ ppc64le)
97101
"hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
98102
update_param KDUMP_COMMANDLINE_APPEND \
99103
"irqpoll nr_cpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 kvm_cma_resv_ratio=0 transparent_hugepage=never novmcoredd hugetlb_cma=0"
104+
update_param FADUMP_COMMANDLINE_APPEND \
105+
"nr_cpus=16 numa=off cgroup_disable=memory cma=0 kvm_cma_resv_ratio=0 hugetlb_cma=0 transparent_hugepage=never novmcoredd udev.children-max=2"
100106
;;
101107
s390x)
102108
update_param KEXEC_ARGS "-s"

kdump-lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fi
1010

1111
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump/enabled"
1212
FADUMP_REGISTER_SYS_NODE="/sys/kernel/fadump/registered"
13+
FADUMP_APPEND_ARGS_SYS_NODE="/sys/kernel/fadump/bootargs_append"
1314

1415
is_uki()
1516
{

kdumpctl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,15 @@ stop_kdump()
11151115

11161116
reload_fadump()
11171117
{
1118+
if "$FADUMP_APPEND_ARGS_SYS_NODE"; then
1119+
output=$(echo "${FADUMP_COMMANDLINE_APPEND}" > "$FADUMP_APPEND_ARGS_SYS_NODE")
1120+
if [ $? -eq 0 ]; then
1121+
output=$(cat "$FADUMP_APPEND_ARGS_SYS_NODE")
1122+
dinfo "fadump: additional parameters '$output' for capture kernel"
1123+
else
1124+
dwarn "WARNING: failed to setup additional parameters for fadump capture kernel ($output)"
1125+
fi
1126+
fi
11181127
if echo 1 > "$FADUMP_REGISTER_SYS_NODE"; then
11191128
dinfo "fadump: re-registered successfully"
11201129
return 0

0 commit comments

Comments
 (0)