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@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
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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"
Checking dracut code, they install sysctl config files via modules.d/98systemd/: There's below files: /etc/sysctl.d/*.conf \ /etc/sysctl.conf
Thus, if we only checking sysctl.conf, we will miss sysctl.d/*.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
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/08/2014 11:22 AM, Dave Young wrote:
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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"
Checking dracut code, they install sysctl config files via modules.d/98systemd/: There's below files: /etc/sysctl.d/*.conf \ /etc/sysctl.conf
Thus, if we only checking sysctl.conf, we will miss sysctl.d/*.conf.
Dave, as /etc/sysctl.d/99-sysctl.conf is a softlink to ../sysctl.conf, I think that shouldn't be a problem?
Thanks Hari
+}
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
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/08/14 at 11:34am, Hari Bathini wrote:
On 12/08/2014 11:22 AM, Dave Young wrote:
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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"
Checking dracut code, they install sysctl config files via modules.d/98systemd/: There's below files: /etc/sysctl.d/*.conf \ /etc/sysctl.conf
Thus, if we only checking sysctl.conf, we will miss sysctl.d/*.conf.
Dave, as /etc/sysctl.d/99-sysctl.conf is a softlink to ../sysctl.conf, I think that shouldn't be a problem?
If there's a /etc/sysctl.d/vm.conf which contains the min_free_kbytes, we can not catch it..
Thanks Hari
+}
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
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/08/14 at 02:08pm, Dave Young wrote:
On 12/08/14 at 11:34am, Hari Bathini wrote:
On 12/08/2014 11:22 AM, Dave Young wrote:
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
Dave, as /etc/sysctl.d/99-sysctl.conf is a softlink to ../sysctl.conf, I think that shouldn't be a problem?
If there's a /etc/sysctl.d/vm.conf which contains the min_free_kbytes, we can not catch it..
Yes, I agree /etc/sysctl.conf and /etc/sysctl.d/* are removed in 99kdumpbase. We didn't include it ever since rhel6, we shouldn't take it into rhel7 now, otherwise it's a regression.
Thanks Baoquan
On 12/08/14 at 01:52pm, Dave Young wrote:
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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"
Checking dracut code, they install sysctl config files via modules.d/98systemd/: There's below files: /etc/sysctl.d/*.conf \ /etc/sysctl.conf
Thus, if we only checking sysctl.conf, we will miss sysctl.d/*.conf.
I checked in RHEL6 era we didn't include sysctl.conf in 2nd kernel. I think we can do the same here. dracut will first install sysctl.conf in 98systemd module and we can remove it in our 99kdump module. Thoughts?
Thanks WANG Chao
+}
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
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/08/2014 11:49 AM, WANG Chao wrote:
On 12/08/14 at 01:52pm, Dave Young wrote:
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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"
Checking dracut code, they install sysctl config files via modules.d/98systemd/: There's below files: /etc/sysctl.d/*.conf \ /etc/sysctl.conf
Thus, if we only checking sysctl.conf, we will miss sysctl.d/*.conf.
Hmmm... That makes it a little tricky.
I checked in RHEL6 era we didn't include sysctl.conf in 2nd kernel. I think we can do the same here. dracut will first install sysctl.conf in 98systemd module and we can remove it in our 99kdump module. Thoughts?
I think the best way to go forward is as suggested by Chao.. To remove sysctl in kdump dracut module..
Thanks Hari
Thanks WANG Chao
+}
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
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/08/14 at 01:24pm, Hari Bathini wrote:
On 12/08/2014 11:49 AM, WANG Chao wrote:
On 12/08/14 at 01:52pm, Dave Young wrote:
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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"
Checking dracut code, they install sysctl config files via modules.d/98systemd/: There's below files: /etc/sysctl.d/*.conf \ /etc/sysctl.conf
Thus, if we only checking sysctl.conf, we will miss sysctl.d/*.conf.
Hmmm... That makes it a little tricky.
I checked in RHEL6 era we didn't include sysctl.conf in 2nd kernel. I think we can do the same here. dracut will first install sysctl.conf in 98systemd module and we can remove it in our 99kdump module. Thoughts?
I think the best way to go forward is as suggested by Chao.. To remove sysctl in kdump dracut module..
Ok, please send a new patch for this.
I think we can do something like below for future fix: 1) add kernel cmdline params like: sysctl.x.y=z [x=vm,net,etc.] [y=min_free_kbytes, etc.] 2) add kernel cmdline, nosysctl so that only the params which are passed in kernel cmdline are used. 3) remove the sysctl.conf deletion in kdump module, suggest user to add nosysctl in cmdline
Thanks Hari
Thanks WANG Chao
+}
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
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 12/08/14 at 05:06pm, Dave Young wrote:
On 12/08/14 at 01:24pm, Hari Bathini wrote:
On 12/08/2014 11:49 AM, WANG Chao wrote:
On 12/08/14 at 01:52pm, Dave Young wrote:
Hi, Hari
Thanks for the update, but sorry that I find some other issue.
Checking dracut code, they install sysctl config files via modules.d/98systemd/:
There's below files: /etc/sysctl.d/*.conf \ /etc/sysctl.conf
Thus, if we only checking sysctl.conf, we will miss sysctl.d/*.conf.
Hmmm... That makes it a little tricky.
I checked in RHEL6 era we didn't include sysctl.conf in 2nd kernel. I think we can do the same here. dracut will first install sysctl.conf in 98systemd module and we can remove it in our 99kdump module. Thoughts?
I think the best way to go forward is as suggested by Chao.. To remove sysctl in kdump dracut module..
Ok, please send a new patch for this.
I think we can do something like below for future fix:
- add kernel cmdline params like: sysctl.x.y=z [x=vm,net,etc.] [y=min_free_kbytes, etc.]
- add kernel cmdline, nosysctl so that only the params which are passed in kernel cmdline are used.
- remove the sysctl.conf deletion in kdump module, suggest user to add nosysctl in cmdline
Interesting, nosysctl is a good idea.
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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
On 12/09/14 at 05:36pm, Dave Young wrote:
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:
- Moved snippet modifying /etc/sysctl.conf file to a new function
- Removed unnecessary expressions while modifying sysctl.conf
Signed-off-by: Hari Bathini hbathini@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
self NACK, I meant to ack the patch for rm sysctl*
Thanks Dave