diff options
author | Daniel Phillips <phillips@google.com> | 2006-03-10 21:08:16 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-06-26 17:42:42 -0400 |
commit | 03d864c02c3ea803b1718940ac6953a257182d7a (patch) | |
tree | 2678c34a75654693ee875d20194830429886ec58 /fs/ocfs2/dlm/dlmcommon.h | |
parent | 95c4f581d6551de55cf5b8693db98b01ce07021b (diff) |
ocfs2: allocate lockres hash pages in an array
This allows us to have a hash table greater than a single page which greatly
improves dlm performance on some tests.
Signed-off-by: Daniel Phillips <phillips@google.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmcommon.h')
-rw-r--r-- | fs/ocfs2/dlm/dlmcommon.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h index 87612819c13b..0378ddbc8a8c 100644 --- a/fs/ocfs2/dlm/dlmcommon.h +++ b/fs/ocfs2/dlm/dlmcommon.h | |||
@@ -37,7 +37,10 @@ | |||
37 | #define DLM_THREAD_SHUFFLE_INTERVAL 5 // flush everything every 5 passes | 37 | #define DLM_THREAD_SHUFFLE_INTERVAL 5 // flush everything every 5 passes |
38 | #define DLM_THREAD_MS 200 // flush at least every 200 ms | 38 | #define DLM_THREAD_MS 200 // flush at least every 200 ms |
39 | 39 | ||
40 | #define DLM_HASH_BUCKETS (PAGE_SIZE / sizeof(struct hlist_head)) | 40 | #define DLM_HASH_SIZE (1 << 14) |
41 | #define DLM_HASH_PAGES (DLM_HASH_SIZE / PAGE_SIZE) | ||
42 | #define DLM_BUCKETS_PER_PAGE (PAGE_SIZE / sizeof(struct hlist_head)) | ||
43 | #define DLM_HASH_BUCKETS (DLM_HASH_PAGES * DLM_BUCKETS_PER_PAGE) | ||
41 | 44 | ||
42 | /* Intended to make it easier for us to switch out hash functions */ | 45 | /* Intended to make it easier for us to switch out hash functions */ |
43 | #define dlm_lockid_hash(_n, _l) full_name_hash(_n, _l) | 46 | #define dlm_lockid_hash(_n, _l) full_name_hash(_n, _l) |
@@ -88,7 +91,7 @@ enum dlm_ctxt_state { | |||
88 | struct dlm_ctxt | 91 | struct dlm_ctxt |
89 | { | 92 | { |
90 | struct list_head list; | 93 | struct list_head list; |
91 | struct hlist_head *lockres_hash; | 94 | struct hlist_head **lockres_hash; |
92 | struct list_head dirty_list; | 95 | struct list_head dirty_list; |
93 | struct list_head purge_list; | 96 | struct list_head purge_list; |
94 | struct list_head pending_asts; | 97 | struct list_head pending_asts; |
@@ -135,6 +138,11 @@ struct dlm_ctxt | |||
135 | struct list_head dlm_eviction_callbacks; | 138 | struct list_head dlm_eviction_callbacks; |
136 | }; | 139 | }; |
137 | 140 | ||
141 | static inline struct hlist_head *dlm_lockres_hash(struct dlm_ctxt *dlm, unsigned i) | ||
142 | { | ||
143 | return dlm->lockres_hash[(i / DLM_BUCKETS_PER_PAGE) % DLM_HASH_PAGES] + (i % DLM_BUCKETS_PER_PAGE); | ||
144 | } | ||
145 | |||
138 | /* these keventd work queue items are for less-frequently | 146 | /* these keventd work queue items are for less-frequently |
139 | * called functions that cannot be directly called from the | 147 | * called functions that cannot be directly called from the |
140 | * net message handlers for some reason, usually because | 148 | * net message handlers for some reason, usually because |