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@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.
Hi, Hari
On 11/25/14 at 11:42am, 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.
Signed-off-by: Hari Bathini hbathini@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"
sysctl vm values are most for normal boot instead of initramfs, so I think default value should be good. But is there any other way to specify the value ie. cmdline param instead of hardcode here?
# 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.
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 11/26/2014 12:08 PM, Dave Young wrote:
Hi, Hari
On 11/25/14 at 11:42am, 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.
Signed-off-by: Hari Bathini hbathini@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"
sysctl vm values are most for normal boot instead of initramfs, so I think default value should be good. But is there any other way to specify the value ie. cmdline param instead of hardcode here?
Dave, that was the first thing I tried. But couldn't find a boot parameter that overrides runtime parameters in sysctl.conf. As sysctl does runtime configuration for kernel parameters, I doubt if there is a boot time parameter to override these options. But if we do have, that would be nice for this kind of scenarios...
Thanks Hari
# 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.
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On Tue, Nov 25, 2014 at 11:42:20AM +0530, 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.
Signed-off-by: Hari Bathini hbathini@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"
Hari,
which service inside dracut applies forces these parameters? It does sound like a problem in kdump environment because lot of these settings might make sense in first kernel (when all cpus and memory is available) but might not make sense in second kernel.
It would be preferrable if we can override those settings based on user inputs instead of hardcoding these. Having said that I am not finding any way to do that.
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
w.r.t patch, what are expressions "-e "/^$/d"" and -e "/^#/d"?
Thanks Vivek
- # 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.
On 12/05/2014 08:41 PM, Vivek Goyal wrote:
On Tue, Nov 25, 2014 at 11:42:20AM +0530, 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.
Signed-off-by: Hari Bathini hbathini@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"
Hari,
which service inside dracut applies forces these parameters? It does sound like a problem in kdump environment because lot of these settings might make sense in first kernel (when all cpus and memory is available) but might not make sense in second kernel.
It would be preferrable if we can override those settings based on user inputs instead of hardcoding these. Having said that I am not finding any way to do that.
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
w.r.t patch, what are expressions "-e "/^$/d"" and -e "/^#/d"?
Since we are here, thought of cleaning the sysctl.conf file in kdump initrd by deleting empty lines and comment lines respectively, as done for kdump.conf file
Thanks Hari
Thanks Vivek
# 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.
On Fri, Dec 05, 2014 at 09:57:41PM +0530, Hari Bathini wrote:
On 12/05/2014 08:41 PM, Vivek Goyal wrote:
On Tue, Nov 25, 2014 at 11:42:20AM +0530, 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.
Signed-off-by: Hari Bathini hbathini@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"
Hari,
which service inside dracut applies forces these parameters? It does sound like a problem in kdump environment because lot of these settings might make sense in first kernel (when all cpus and memory is available) but might not make sense in second kernel.
It would be preferrable if we can override those settings based on user inputs instead of hardcoding these. Having said that I am not finding any way to do that.
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
w.r.t patch, what are expressions "-e "/^$/d"" and -e "/^#/d"?
Since we are here, thought of cleaning the sysctl.conf file in kdump initrd by deleting empty lines and comment lines respectively, as done for kdump.conf file
Ok, I don't think it was required but I am not particular about it. So..
Acked-by: Vivek Goyal vgoyal@redhat.com
Thanks Vivek
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
Reasonable to me about above idea, but it will introduce a new problem: it works without any user input with this patch, but user will need specify cmdline by themselves.
As for patch itself, Hari, can you please move the code to a function?
Thanks Dave
On 12/08/2014 08:07 AM, Dave Young wrote:
So I guess for the time being we can take this patch. If more problems like this crop up, we might have to request dracut guys to provide us a command line option where sysctl options can be specified and user will need to provide those command line options.
Reasonable to me about above idea, but it will introduce a new problem: it works without any user input with this patch, but user will need specify cmdline by themselves.
As for patch itself, Hari, can you please move the code to a function?
Posted the updated patch. Please review...
Thanks Hari
Thanks Dave