cluster: RHEL59 - cman init: allow dlm hash table sizes to be tunable at startup

Fabio M. Di Nitto fabbione at fedoraproject.org
Tue Jul 24 06:56:14 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=332db7754d6210991c34be056789aa1b33b26a0a
Commit:        332db7754d6210991c34be056789aa1b33b26a0a
Parent:        77bb92ad9dbad9c8755e45211214ab1e099cdb0e
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Tue Jul 24 08:55:27 2012 +0200
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Tue Jul 24 08:55:27 2012 +0200

cman init: allow dlm hash table sizes to be tunable at startup

Resolves: rhbz#836963

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 cman/init.d/cman |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/cman/init.d/cman b/cman/init.d/cman
index 4727d22..2101eb7 100755
--- a/cman/init.d/cman
+++ b/cman/init.d/cman
@@ -297,6 +297,37 @@ fence_join_enabled()
     fi
 }
 
+tune_dlm_hash_sizes()
+{
+	dlmdir="/sys/kernel/config/dlm/cluster"
+	maxloop=21
+
+	if [ -z "$DLM_LKBTBL_SIZE" ] && \
+	   [ -z "$DLM_RSBTBL_SIZE" ] && \
+	   [ -z "$DLM_DIRTBL_SIZE" ]; then
+		return 0
+	fi
+	for i in $(seq 1 $maxloop); do
+		if [ -d $dlmdir ]; then
+			break
+		fi
+		sleep 0.5
+	done
+	if [ "$i" = "$maxloop" ]; then
+		return 1
+	fi
+	if [ -n "$DLM_LKBTBL_SIZE" ]; then
+		echo $DLM_LKBTBL_SIZE > $dlmdir/lkbtbl_size
+	fi
+	if [ -n "$DLM_RSBTBL_SIZE" ]; then
+		echo $DLM_RSBTBL_SIZE > $dlmdir/rsbtbl_size
+	fi
+	if [ -n "$DLM_DIRTBL_SIZE" ]; then
+		echo $DLM_DIRTBL_SIZE > $dlmdir/dirtbl_size
+	fi
+	return 0
+}
+
 start()
 {
     echo "Starting cluster: "
@@ -391,7 +422,17 @@ start()
 	return 1
 	fi
     fi
-    
+
+    echo -n "   Tuning DLM... "
+    tune_dlm_hash_sizes
+    if [ $? -eq 0 ] 
+    then
+	echo "done"
+    else
+	echo "failed"
+	return 1
+    fi
+
     return 0
 }
 


More information about the cluster-commits mailing list