aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2008-06-03 09:09:53 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2008-06-27 04:39:44 -0400
commit1bdad606338debc6384b2844f1b53cc436b3ac90 (patch)
tree7929bc1f652f88f104e8b6fa6a424cd211b50a42 /fs/gfs2/locking
parent9171f5a991e7613cbee816874ad8c9515dcab50f (diff)
[GFS2] Remove remote lock dropping code
There are several reasons why this is undesirable: 1. It never happens during normal operation anyway 2. If it does happen it causes performance to be very, very poor 3. It isn't likely to solve the original problem (memory shortage on remote DLM node) it was supposed to solve 4. It uses a bunch of arbitrary constants which are unlikely to be correct for any particular situation and for which the tuning seems to be a black art. 5. In an N node cluster, only 1/N of the dropped locked will actually contribute to solving the problem on average. So all in all we are better off without it. This also makes merging the lock_dlm module into GFS2 a bit easier. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r--fs/gfs2/locking/dlm/lock_dlm.h3
-rw-r--r--fs/gfs2/locking/dlm/mount.c3
-rw-r--r--fs/gfs2/locking/dlm/sysfs.c13
-rw-r--r--fs/gfs2/locking/dlm/thread.c19
4 files changed, 0 insertions, 38 deletions
diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h
index ad944c64eab1..845a27fd303e 100644
--- a/fs/gfs2/locking/dlm/lock_dlm.h
+++ b/fs/gfs2/locking/dlm/lock_dlm.h
@@ -79,9 +79,6 @@ struct gdlm_ls {
79 wait_queue_head_t wait_control; 79 wait_queue_head_t wait_control;
80 struct task_struct *thread; 80 struct task_struct *thread;
81 wait_queue_head_t thread_wait; 81 wait_queue_head_t thread_wait;
82 unsigned long drop_time;
83 int drop_locks_count;
84 int drop_locks_period;
85}; 82};
86 83
87enum { 84enum {
diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c
index 0628520a445f..fa31c54c2e67 100644
--- a/fs/gfs2/locking/dlm/mount.c
+++ b/fs/gfs2/locking/dlm/mount.c
@@ -22,8 +22,6 @@ static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs2_sbd *sdp,
22 if (!ls) 22 if (!ls)
23 return NULL; 23 return NULL;
24 24
25 ls->drop_locks_count = GDLM_DROP_COUNT;
26 ls->drop_locks_period = GDLM_DROP_PERIOD;
27 ls->fscb = cb; 25 ls->fscb = cb;
28 ls->sdp = sdp; 26 ls->sdp = sdp;
29 ls->fsflags = flags; 27 ls->fsflags = flags;
@@ -33,7 +31,6 @@ static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs2_sbd *sdp,
33 INIT_LIST_HEAD(&ls->all_locks); 31 INIT_LIST_HEAD(&ls->all_locks);
34 init_waitqueue_head(&ls->thread_wait); 32 init_waitqueue_head(&ls->thread_wait);
35 init_waitqueue_head(&ls->wait_control); 33 init_waitqueue_head(&ls->wait_control);
36 ls->drop_time = jiffies;
37 ls->jid = -1; 34 ls->jid = -1;
38 35
39 strncpy(buf, table_name, 256); 36 strncpy(buf, table_name, 256);
diff --git a/fs/gfs2/locking/dlm/sysfs.c b/fs/gfs2/locking/dlm/sysfs.c
index a4ff271df9ee..4ec571c3d8a9 100644
--- a/fs/gfs2/locking/dlm/sysfs.c
+++ b/fs/gfs2/locking/dlm/sysfs.c
@@ -114,17 +114,6 @@ static ssize_t recover_status_show(struct gdlm_ls *ls, char *buf)
114 return sprintf(buf, "%d\n", ls->recover_jid_status); 114 return sprintf(buf, "%d\n", ls->recover_jid_status);
115} 115}
116 116
117static ssize_t drop_count_show(struct gdlm_ls *ls, char *buf)
118{
119 return sprintf(buf, "%d\n", ls->drop_locks_count);
120}
121
122static ssize_t drop_count_store(struct gdlm_ls *ls, const char *buf, size_t len)
123{
124 ls->drop_locks_count = simple_strtol(buf, NULL, 0);
125 return len;
126}
127
128struct gdlm_attr { 117struct gdlm_attr {
129 struct attribute attr; 118 struct attribute attr;
130 ssize_t (*show)(struct gdlm_ls *, char *); 119 ssize_t (*show)(struct gdlm_ls *, char *);
@@ -144,7 +133,6 @@ GDLM_ATTR(first_done, 0444, first_done_show, NULL);
144GDLM_ATTR(recover, 0644, recover_show, recover_store); 133GDLM_ATTR(recover, 0644, recover_show, recover_store);
145GDLM_ATTR(recover_done, 0444, recover_done_show, NULL); 134GDLM_ATTR(recover_done, 0444, recover_done_show, NULL);
146GDLM_ATTR(recover_status, 0444, recover_status_show, NULL); 135GDLM_ATTR(recover_status, 0444, recover_status_show, NULL);
147GDLM_ATTR(drop_count, 0644, drop_count_show, drop_count_store);
148 136
149static struct attribute *gdlm_attrs[] = { 137static struct attribute *gdlm_attrs[] = {
150 &gdlm_attr_proto_name.attr, 138 &gdlm_attr_proto_name.attr,
@@ -157,7 +145,6 @@ static struct attribute *gdlm_attrs[] = {
157 &gdlm_attr_recover.attr, 145 &gdlm_attr_recover.attr,
158 &gdlm_attr_recover_done.attr, 146 &gdlm_attr_recover_done.attr,
159 &gdlm_attr_recover_status.attr, 147 &gdlm_attr_recover_status.attr,
160 &gdlm_attr_drop_count.attr,
161 NULL, 148 NULL,
162}; 149};
163 150
diff --git a/fs/gfs2/locking/dlm/thread.c b/fs/gfs2/locking/dlm/thread.c
index f30350abd62f..38823efd698c 100644
--- a/fs/gfs2/locking/dlm/thread.c
+++ b/fs/gfs2/locking/dlm/thread.c
@@ -20,19 +20,6 @@ static inline int no_work(struct gdlm_ls *ls)
20 return ret; 20 return ret;
21} 21}
22 22
23static inline int check_drop(struct gdlm_ls *ls)
24{
25 if (!ls->drop_locks_count)
26 return 0;
27
28 if (time_after(jiffies, ls->drop_time + ls->drop_locks_period * HZ)) {
29 ls->drop_time = jiffies;
30 if (ls->all_locks_count >= ls->drop_locks_count)
31 return 1;
32 }
33 return 0;
34}
35
36static int gdlm_thread(void *data) 23static int gdlm_thread(void *data)
37{ 24{
38 struct gdlm_ls *ls = (struct gdlm_ls *) data; 25 struct gdlm_ls *ls = (struct gdlm_ls *) data;
@@ -52,12 +39,6 @@ static int gdlm_thread(void *data)
52 gdlm_do_lock(lp); 39 gdlm_do_lock(lp);
53 spin_lock(&ls->async_lock); 40 spin_lock(&ls->async_lock);
54 } 41 }
55 /* Does this ever happen these days? I hope not anyway */
56 if (check_drop(ls)) {
57 spin_unlock(&ls->async_lock);
58 ls->fscb(ls->sdp, LM_CB_DROPLOCKS, NULL);
59 spin_lock(&ls->async_lock);
60 }
61 spin_unlock(&ls->async_lock); 42 spin_unlock(&ls->async_lock);
62 } 43 }
63 44