On 12/08/14 at 10:57am, Hari Bathini wrote:
When the value of vm.min_free_kbytes is set too high in
/etc/sysctl.conf,
kdump kernel fails with OOM. As min_free_kbytes may not be relevant for
kdump kernel, this patch tries to fix the issue by removing it from the
file sysctl.conf and thus forcing default value for vm.min_free_kbytes
parameter.
Changes from v1 to v2:
1. Moved snippet modifying /etc/sysctl.conf file to a new function
2. Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini <hbathini(a)linux.vnet.ibm.com>
---
dracut-module-setup.sh | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..72871d0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -378,6 +378,16 @@ kdump_install_conf() {
rm -f /tmp/$$-kdump.conf
}
+# Certain things configured in /etc/sysctl.conf are not relevant
+# for kdump kernel. Tune them here
+kdump_sysctl_conf() {
+
+ # While min_free_kbytes may not be relevant for kdump kernel,
+ # it leads to OOM in cases where this value is too high.
+ # Let's be paranoid and force it to default value calculated by kernel.
+ sed -e "/min_free_kbytes/d" /etc/sysctl.conf >
"${initdir}/etc/sysctl.conf"
+}
+
kdump_iscsi_get_rec_val() {
local result
@@ -586,6 +596,7 @@ kdump_install_random_seed() {
install() {
kdump_install_conf
+ kdump_sysctl_conf
if is_ssh_dump_target; then
kdump_install_random_seed
ACK
Thanks
Dave