Commit Graph

14 Commits

Author SHA1 Message Date
Tao Liu
d5fe96cd7a Disable CMA in kdump 2nd kernel
kexec-tools needs to disable CMA for kdump kernel cmdline,
otherwise kdump kernel may run out of memory.

This patch strips the inherited cma=, hugetlb_cma= cmd
line from 1st kernel, and sets to be 0 for 2nd kernel.

Signed-off-by: Tao Liu <ltao@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
2021-05-13 17:13:39 +08:00
Lianbo Jiang
8b0a755b82 Update the kdump sysconfig
Some unused log levels have been removed, and kdump has used the
different options to control the log levels for the first kernel
and the second kernel. Therefore, let's update the kdump sysconfig
accordingly.

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
2020-11-13 02:49:56 +08:00
Lianbo Jiang
d001bd177f kdump.sysconfig: add the kdump logger configurations
The kdump logger has the default values of the log levels, but
sometimes, need to change the value of log level in order to
get more debugging messages for troubleshooting.

Here, user will have a chance to reconfigure it.

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
Acked-by: Kairui Song <kasong@redhat.com>
2020-10-27 17:33:58 +08:00
Kairui Song
134c578463 Don't inherit swiotlb parameter form 1st kernel by default
Usually kdump kernel don't need a swiotlb. There are two cases known
common case a swiotlb is needed:

 - SEV/SME is active.
 - crashkernel high reservation is used, or there are crashkernel memory
   above 4G.

For both case, if swiotlb is set to a large value in first kernel, kdump
kernel will likely to fail with OOM. So don't inherit swiotlb parameter
by default.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Pingfan Liu <piliu@redhat.com>
2020-05-29 10:56:31 +08:00
Lianbo Jiang
a81ec90ed8 kdump.sysconfig: Remove the option 'log_buf_len' from kdump command line
The option 'log_buf_len' in the kernel command line will make kernel
dynamically allocate memory (system ram) from memblock and always hold
the memory allocated. If the size of this option is misused such as
'log_buf_len=64M'. This may cause a short of memory for kdump kernel,
because the size of memory is usually limited in kdump kernel.

In order to avoid this problem, need to remove this option from the
kdump kernel command line.

Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
Acked-by: Pingfan Liu <piliu@redhat.com>
2020-05-28 10:11:15 +08:00
Kairui Song
ff329689b3 Disable device dump by default
Device dump may use a log of memory and cause OOM issue, so append
"novmcoredd" option for second kernel and disable it by default.
To use device dump, user should remove the vmcoredd parameter
manually.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2019-09-02 17:06:09 +08:00
Kairui Song
94a7b43407 Always drop nofail or nobootwait options
If nofail or nobootwait option is used, systemd's local-fs.target won't
wait for the mounting to complete, and kdump might start before the
required mount point is ready and then fail.

The host might use nofail for reasons like the device may get unpluged,
and if the device is not mounted and it is set as kdump target as the same
time then kdump service won't start, we will never enter the capture
kernel. By the time we have entered the capture kernel, the target device
must exist and ready to use, or else kdump would fail anyway. So force
remove nofail and nobootwait option.

Also drop rootflags=nofail option, as we don't depend on rootfs anymore
if the dump target don't required it. So the nofail option is no longer
needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2018-08-14 10:34:45 +08:00
Pingfan Liu
c14ebf2676 kdump.sysconfig.ppc64(le): remove "root=" param from ppc64(le) 2nd kernel's command line
For ppc64(le), the default behavior of kexec always copy "root=" param,
but if dump target is ssh, there will no tools installed in kdump
rd, which help to mount root. As a result, kdump service will fail to
start. So explicitly disable the default behavior with --dt_no_old_root
option.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2018-03-22 16:15:08 +08:00
Dave Young
53564adc08 Remove kernel param "quiet" from kdump kernel cmdline
"quiet" will disable most of log messages. For debugging kdump
kernel purpose it is better to remove quiet in 2nd kernel so that
we always see kernel messages.

Signed-off-by: Dangyi Liu <dliu@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2015-12-11 15:18:31 +08:00
Dangyi Liu
3ec336c06c kdump.sysconfig: add KDUMP_COMMANDLINE_REMOVE
Use KDUMP_COMMANDLINE_REMOVE config instead of hardcode them in
kdumpctl, which makes it possible system admins decide what params to
remove such as "quiet" or other debug flags.

This patch also adds backward compatibility even if an old config is
used. It will behave the same as the old version.

Signed-off-by: Dangyi Liu <dliu@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
2015-12-11 15:16:35 +08:00
Li Wang
0aada50b66 Disable transparent hugepages in second kernel
Transparent hugepages are on by default. Disable it in kdump kernel by
adding the parameter 'transparent_hugepage=never'. This might help us
with some of the memory issues we are facing.

From my test on two arch, not only there are no any bad effect on saving vmcore
after turn off THP, but also we can get more 'MemAvailable:' in the kdump kernel.

1)x86_64
without the parameter
=====================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/mapper/rhel_ibm--x3250m4--01-root ro rd.lvm.lv=rhel_ibm-x3250m4-01/swap console=ttyS0,115200n8 rd.lvm.lv=rhel_ibm-x3250m4-01/root LANG=en_US.UTF-8 irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug disable_cpu_apicid=0 elfcorehdr=869764K

kdump:/# cat /proc/meminfo
MemTotal:         145492 kB
MemFree:           68284 kB
MemAvailable:     111632 kB  <<------
Buffers:              36 kB
Cached:            48184 kB
...

added the parameter
=====================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.x86_64 root=/dev/mapper/rhel_ibm--x3250m4--01-root ro rd.lvm.lv=rhel_ibm-x3250m4-01/swap console=ttyS0,115200n8 rd.lvm.lv=rhel_ibm-x3250m4-01/root LANG=en_US.UTF-8 irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug transparent_hugepage=never disable_cpu_apicid=0 elfcorehdr=869764K

kdump:/# cat /proc/meminfo
MemTotal:         145492 kB
MemFree:           68388 kB
MemAvailable:     111728 kB  <<-------
...
VmallocChunk:   34359659520 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
...

2)ppc64
without the parameter
====================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.ppc64 root=/dev/mapper/rhel_ibm--p8--05--lp6-root ro rd.lvm.lv=rhel_ibm-p8-05-lp6/root rd.lvm.lv=rhel_ibm-p8-05-lp6/swap LANG=en_US.UTF-8 irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 elfcorehdr=154880K

kdump:/# cat /proc/meminfo
MemTotal:         480832 kB
MemFree:          293952 kB
MemAvailable:     427840 kB  <<--------
mallocUsed:       23680 kB
VmallocChunk:   8589901824 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
...

added the parameter
===================
kdump:/# cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.10.0-229.el7.ppc64 root=/dev/mapper/rhel_ibm--p8--05--lp6-root ro rd.lvm.lv=rhel_ibm-p8-05-lp6/root rd.lvm.lv=rhel_ibm-p8-05-lp6/swap LANG=en_US.UTF-8 irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_disable=memory numa=off udev.children-max=2 ehea.use_mcs=0 panic=10 rootflags=nofail kvm_cma_resv_ratio=0 transparent_hugepage=never elfcorehdr=154880K

kdump:/# cat /proc/meminfo
MemTotal:         480832 kB
MemFree:          294592 kB
MemAvailable:     428480 kB  <<-------
...
HugePages_Total:       0

Signed-off-by: Li Wang <liwang@redhat.com>
Acked-by: Minfei Huang <mhuang@redhat.com>
Acked-by: Baoquan He <bhe@redaht.com>
2015-06-03 21:07:22 +08:00
Baoquan He
cad991814e kdumpctl: adjust the boot dir if kernel is put in sub dir of /boot
Previously /boot is asumed as the default dir where kernel and initrd
is put. However, the directory containing the running kernel image
on Atomic systems differs in each installation. Usually something like:

/boot/ostree/rhel-atomic-host-b50a015b637c353dc6554c851f8a1212b60d6121a7316715e4a63e2a4113cd72

This means that kdump will not find vmlinuz when installed on an
Atomic host, and thus the kdump service will fail to start.

In this patch, the kdump boot dir finding behaviour is a little changed.
Firstly check whether user has specify a directory explicitly in
/etc/sysconfig/kdump. If yes that is respected. Otherwise we assume
1st kernel and kdump kernel are put in the same place under /boot.
Then find it according /proc/cmdline and append it to /boot/

Note:
So now the KDUMP_BOOTDIR in /etc/sysconfig/kdump is set as empty
by default. If user set KDUMP_BOOTDIR to a directory, then he need to
take care of all related things himself. otherwise kdump script handle
it automatically.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Acked-by: Minfei Huang <mhuang@redhat.com>
2015-01-30 14:53:34 +08:00
WANG Chao
7d8e65d615 ppc64, ppc64le: disable kvm CMA reservation in kdump kernel
By default on powerpc platform, kvm will reserve a relatively large CMA
(128M aligned) at early boot. In kdump kernel, even KVM sounds useless
but still it reserves 128M and makes kdump kernel fail to boot.

Now fix this by adding the following to kernel command line:

"kvm_cma_resv_ratio=0"

which disable the CMA reservation.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-09-26 12:59:04 +08:00
WANG Chao
aa289b9140 ppc64le: Add arch specific sysconfig
kdump.sysconfig.ppc64le is copied from kdump.sysconfig.ppc64. The
default sysconfig won't work for ppc64le.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-09-23 11:22:45 +08:00