[Ocfs2-devel] [PATCH 2/3] OCFS2: speed up dlm_lockr_resouce hash_table lookups

wengang wang wen.gang.wang at oracle.com
Thu Apr 30 21:56:06 PDT 2009


allocates at least one page.

mainline git commit: c8f33b6e86af74ee7b800f57cac7b3c8559318fe
Authored-by: Joel Becker <joel.becker at oracle.com>
Signed-off-by: Wengang Wang <wen.gang.wang at oracle.com>
--
Index: ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h
===================================================================
--- ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h	(revision 2)
+++ ocfs2-1.2/fs/ocfs2/dlm/dlmcommon.h	(revision 3)
@@ -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)
 



More information about the Ocfs2-devel mailing list