[PATCH] Add checking num-threads of makedumpfile

Zhou Wenjian zhouwj-fnst at cn.fujitsu.com
Tue Aug 25 04:51:35 UTC 2015


A new feature that doing compressing and writing by multi-threads
has been added in makedumpfile. The thread num is specified by
"--num-threads NUM". According to its implementation, there will
be performance degradation if the threads are more than cpus.
So we should check it.

Signed-off-by: Zhou wenjian <zhouwj-fnst at cn.fujitsu.com>
---
 kdumpctl |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/kdumpctl b/kdumpctl
index b504734..a4b4681 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -259,6 +259,22 @@ check_config()
 		esac
 	done < $KDUMP_CONFIG_FILE
 
+	grep -v "^#" $KDUMP_CONFIG_FILE | grep -q "num-threads"
+	if [ $? -eq 0 ];then
+		local nr_cpus=1
+		local num_threads=0
+		local core_collector=`grep -v "^#" $KDUMP_CONFIG_FILE | grep "^core_collector"`
+
+		num_threads=`echo ${core_collector#*--num-threads} | awk '{print $1}'`
+		nr_cpus=`echo ${KDUMP_COMMANDLINE_APPEND#*nr_cpus=} | awk '{print $1}'`
+
+		test $num_threads -ge $nr_cpus &> /dev/null
+		if [ $? -eq 0 ];then
+			echo "The num_threads:$num_threads(specified in /etc/kdump.conf) should be less than nr_cpus:$nr_cpus(specified in /etc/sysconfig/kdump)"
+			echo "or makedumpfile may have bad performance!"
+		fi
+	fi
+
 	check_fence_kdump_config || return 1
 
 	return 0
-- 
1.7.1



More information about the kexec mailing list