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

Hari Bathini hbathini at linux.vnet.ibm.com
Thu Nov 27 16:34:24 UTC 2014


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 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"
>> +
> 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 at lists.fedoraproject.org
>> https://lists.fedoraproject.org/mailman/listinfo/kexec



More information about the kexec mailing list