Skip to contentSkip to conversation

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

PATCH New Fabio M. Di Nitto 2 participants 2 messages Jul 25, 2012

lore
Share & tools
lore
#0 lore raw

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

From: "Fabio M. Di Nitto" <[email protected]>

Resolves: rhbz#842370

---
 cman/init.d/cman.in               |   28 ++++++++++++++++++++++++++++
 cman/init.d/cman.init.defaults.in |    7 +++++++
 2 files changed, 35 insertions(+), 0 deletions(-)
cman/init.d/cman.in +28 -0
index 9a0d726..9de349d 100644
@@ -110,6 +110,13 @@ fi
 # DLM_CONTROLD_OPTS -- allow extra options to be passed to dlm_controld daemon.
 [ -z "$DLM_CONTROLD_OPTS" ] && DLM_CONTROLD_OPTS=""
 
+# DLM_LKBTBL_SIZE - DLM_RSBTBL_SIZE - DLM_DIRTBL_SIZE
+# Allow tuning of DLM kernel hash table sizes.
+# do NOT change unless instructed to do so.
+[ -z "$DLM_LKBTBL_SIZE" ] && DLM_LKBTBL_SIZE=""
+[ -z "$DLM_RSBTBL_SIZE" ] && DLM_RSBTBL_SIZE=""
+[ -z "$DLM_DIRTBL_SIZE" ] && DLM_DIRTBL_SIZE=""
+
 # FENCE_JOIN_TIMEOUT -- seconds to wait for fence domain join to
 #     complete.  If the join hasn't completed in this time, fence_tool join
 #     exits with an error, and this script exits with an error.  To wait
@@ -706,6 +713,23 @@ leave_fence_domain()
 	fi
 }
 
+tune_dlm_hash_sizes()
+{
+	dlmdir="/sys/kernel/config/dlm/cluster"
+
+	[ -n "$DLM_LKBTBL_SIZE" ] && [ -f $dlmdir/lkbtbl_size ] && \
+	  echo $DLM_LKBTBL_SIZE > $dlmdir/lkbtbl_size
+
+	[ -n "$DLM_RSBTBL_SIZE" ] && [ -f $dlmdir/rsbtbl_size ] && \
+	  echo $DLM_RSBTBL_SIZE > $dlmdir/rsbtbl_size
+
+	[ -n "$DLM_DIRTBL_SIZE" ] && [ -f $dlmdir/dirtbl_size ] && \
+	  echo $DLM_DIRTBL_SIZE > $dlmdir/dirtbl_size
+
+	return 0
+}
+	
+
 start()
 {
 	currentaction="start"
@@ -773,6 +797,10 @@ start()
 		none \
 		"Starting dlm_controld"
 
+	runwrap tune_dlm_hash_sizes \
+		none \
+		"Tuning DLM kernel hash tables"
+
 	runwrap start_gfs_controld \
 		none \
 		"Starting gfs_controld"
cman/init.d/cman.init.defaults.in +7 -0
index 1b7913e..bbaa049 100644
@@ -34,6 +34,13 @@
 # DLM_CONTROLD_OPTS -- allow extra options to be passed to dlm_controld daemon.
 #DLM_CONTROLD_OPTS=""
 
+# DLM_LKBTBL_SIZE - DLM_RSBTBL_SIZE - DLM_DIRTBL_SIZE
+# Allow tuning of DLM kernel hash table sizes.
+# do NOT change unless instructed to do so.
+#DLM_LKBTBL_SIZE=""
+#DLM_RSBTBL_SIZE=""
+#DLM_DIRTBL_SIZE=""
+
 # FENCE_JOIN_TIMEOUT -- seconds to wait for fence domain join to
 #     complete.  If the join hasn't completed in this time, fence_tool join
 #     exits with an error, and this script exits with an error.  To wait
Signature · 1 line
1.7.7.6
#1 lore raw

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

Quoted 3 lines · Fabio M. Di Nitto

From: "Fabio M. Di Nitto" <[email protected]>

Resolves: rhbz#842370

looks good, thanks

cman/init.d/cman.in fi · line 115

Quoted 3 lines
cman/init.d/cman.in +3 -0
+# DLM_LKBTBL_SIZE - DLM_RSBTBL_SIZE - DLM_DIRTBL_SIZE
+# Allow tuning of DLM kernel hash table sizes.
+# do NOT change unless instructed to do so.

Maybe something like "only change these according to documented instructions"? Because I believe there are instructions somewhere (RH customer portal?) about when/how to change these.