Skip to contentSkip to conversation

OCFS2: speed up dlm_lockr_resouce hash_table lookups

PATCH New wengang wang 1 participant 1 message May 1, 2009 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 OCFS2: speed up dlm_lockr_resouce hash_table lookups

allocates at least one page.

mainline git commit: c8f33b6e86af74ee7b800f57cac7b3c8559318fe

--

fs/ocfs2/dlm/dlmcommon.h +6 -2
Index: ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h
===================================================================
@@ -37,8 +37,12 @@
 #define DLM_THREAD_SHUFFLE_INTERVAL    5     // flush everything every 5 passes
 #define DLM_THREAD_MS                  200   // flush at least every 200 ms
 
-#define DLM_HASH_SIZE		(1 << 14)
-#define DLM_HASH_PAGES		(DLM_HASH_SIZE / PAGE_SIZE)
+#define DLM_HASH_SIZE_DEFAULT	(1 << 14)
+#if DLM_HASH_SIZE_DEFAULT < PAGE_SIZE
+# define DLM_HASH_PAGES		1
+#else
+# define DLM_HASH_PAGES		(DLM_HASH_SIZE_DEFAULT / PAGE_SIZE)
+#endif
 #define DLM_BUCKETS_PER_PAGE	(PAGE_SIZE / sizeof(struct hlist_head))
 #define DLM_HASH_BUCKETS	(DLM_HASH_PAGES * DLM_BUCKETS_PER_PAGE)