[PATCH] kdump: fix OOM issue when vm.min_free_kbytes is set too high

Hari Bathini hbathini at linux.vnet.ibm.com
Tue Nov 25 06:12:20 UTC 2014


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.

Signed-off-by: Hari Bathini <hbathini at linux.vnet.ibm.com>
---
 dracut-module-setup.sh |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index dcebc47..6ada7d3 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -612,6 +612,11 @@ install() {
     # Also redirect dracut-emergency to kdump error handler
     ln_r "$systemdsystemunitdir/emergency.service" "$systemdsystemunitdir/dracut-emergency.service"
 
+    # 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 in kernel.
+    sed -e "/^$/d" -e "/^#/d" -e "/min_free_kbytes/d" /etc/sysctl.conf > "${initdir}/etc/sysctl.conf"
+
     # Check for all the devices and if any device is iscsi, bring up iscsi
     # target. Ideally all this should be pushed into dracut iscsi module
     # at some point of time.



More information about the kexec mailing list