dlm: convert rsb list to rb_tree

Change the linked lists to rb_tree's in the rsb
hash table to speed up searches.  Slow rsb searches
were having a large impact on gfs2 performance due
to the large number of dlm locks gfs2 uses.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
This commit is contained in:
Bob Peterson
2011-10-26 15:24:55 -05:00
committed by David Teigland
parent c3b92c8787
commit 9beb3bf5a9
5 changed files with 112 additions and 54 deletions

View File

@@ -103,8 +103,8 @@ struct dlm_dirtable {
};
struct dlm_rsbtable {
struct list_head list;
struct list_head toss;
struct rb_root keep;
struct rb_root toss;
spinlock_t lock;
};
@@ -285,7 +285,10 @@ struct dlm_rsb {
unsigned long res_toss_time;
uint32_t res_first_lkid;
struct list_head res_lookup; /* lkbs waiting on first */
struct list_head res_hashchain; /* rsbtbl */
union {
struct list_head res_hashchain;
struct rb_node res_hashnode; /* rsbtbl */
};
struct list_head res_grantqueue;
struct list_head res_convertqueue;
struct list_head res_waitqueue;