diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-01-19 04:30:01 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-01-21 04:39:08 -0500 |
commit | bc015cb84129eb1451913cfebece270bf7a39e0f (patch) | |
tree | 4f116a61b802d87ae80051e9ae05d8fcb73d9ae7 /fs/gfs2/glock.h | |
parent | 2b1caf6ed7b888c95a1909d343799672731651a5 (diff) |
GFS2: Use RCU for glock hash table
This has a number of advantages:
- Reduces contention on the hash table lock
- Makes the code smaller and simpler
- Should speed up glock dumps when under load
- Removes ref count changing in examine_bucket
- No longer need hash chain lock in glock_put() in common case
There are some further changes which this enables and which
we may do in the future. One is to look at using SLAB_RCU,
and another is to look at using a per-cpu counter for the
per-sb glock counter, since that is touched twice in the
lifetime of each glock (but only used at umount time).
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'fs/gfs2/glock.h')
-rw-r--r-- | fs/gfs2/glock.h | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h index 691851ceb615..afa8bfea5647 100644 --- a/fs/gfs2/glock.h +++ b/fs/gfs2/glock.h | |||
@@ -118,7 +118,7 @@ struct lm_lockops { | |||
118 | int (*lm_mount) (struct gfs2_sbd *sdp, const char *fsname); | 118 | int (*lm_mount) (struct gfs2_sbd *sdp, const char *fsname); |
119 | void (*lm_unmount) (struct gfs2_sbd *sdp); | 119 | void (*lm_unmount) (struct gfs2_sbd *sdp); |
120 | void (*lm_withdraw) (struct gfs2_sbd *sdp); | 120 | void (*lm_withdraw) (struct gfs2_sbd *sdp); |
121 | void (*lm_put_lock) (struct kmem_cache *cachep, struct gfs2_glock *gl); | 121 | void (*lm_put_lock) (struct gfs2_glock *gl); |
122 | int (*lm_lock) (struct gfs2_glock *gl, unsigned int req_state, | 122 | int (*lm_lock) (struct gfs2_glock *gl, unsigned int req_state, |
123 | unsigned int flags); | 123 | unsigned int flags); |
124 | void (*lm_cancel) (struct gfs2_glock *gl); | 124 | void (*lm_cancel) (struct gfs2_glock *gl); |
@@ -174,7 +174,7 @@ int gfs2_glock_get(struct gfs2_sbd *sdp, | |||
174 | int create, struct gfs2_glock **glp); | 174 | int create, struct gfs2_glock **glp); |
175 | void gfs2_glock_hold(struct gfs2_glock *gl); | 175 | void gfs2_glock_hold(struct gfs2_glock *gl); |
176 | void gfs2_glock_put_nolock(struct gfs2_glock *gl); | 176 | void gfs2_glock_put_nolock(struct gfs2_glock *gl); |
177 | int gfs2_glock_put(struct gfs2_glock *gl); | 177 | void gfs2_glock_put(struct gfs2_glock *gl); |
178 | void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags, | 178 | void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, unsigned flags, |
179 | struct gfs2_holder *gh); | 179 | struct gfs2_holder *gh); |
180 | void gfs2_holder_reinit(unsigned int state, unsigned flags, | 180 | void gfs2_holder_reinit(unsigned int state, unsigned flags, |
@@ -223,25 +223,22 @@ static inline int gfs2_glock_nq_init(struct gfs2_glock *gl, | |||
223 | return error; | 223 | return error; |
224 | } | 224 | } |
225 | 225 | ||
226 | /* Lock Value Block functions */ | 226 | extern void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state); |
227 | 227 | extern void gfs2_glock_complete(struct gfs2_glock *gl, int ret); | |
228 | int gfs2_lvb_hold(struct gfs2_glock *gl); | 228 | extern void gfs2_reclaim_glock(struct gfs2_sbd *sdp); |
229 | void gfs2_lvb_unhold(struct gfs2_glock *gl); | 229 | extern void gfs2_gl_hash_clear(struct gfs2_sbd *sdp); |
230 | 230 | extern void gfs2_glock_finish_truncate(struct gfs2_inode *ip); | |
231 | void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state); | 231 | extern void gfs2_glock_thaw(struct gfs2_sbd *sdp); |
232 | void gfs2_glock_complete(struct gfs2_glock *gl, int ret); | 232 | extern void gfs2_glock_schedule_for_reclaim(struct gfs2_glock *gl); |
233 | void gfs2_reclaim_glock(struct gfs2_sbd *sdp); | 233 | extern void gfs2_glock_free(struct rcu_head *rcu); |
234 | void gfs2_gl_hash_clear(struct gfs2_sbd *sdp); | 234 | |
235 | void gfs2_glock_finish_truncate(struct gfs2_inode *ip); | 235 | extern int __init gfs2_glock_init(void); |
236 | void gfs2_glock_thaw(struct gfs2_sbd *sdp); | 236 | extern void gfs2_glock_exit(void); |
237 | 237 | ||
238 | int __init gfs2_glock_init(void); | 238 | extern int gfs2_create_debugfs_file(struct gfs2_sbd *sdp); |
239 | void gfs2_glock_exit(void); | 239 | extern void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp); |
240 | 240 | extern int gfs2_register_debugfs(void); | |
241 | int gfs2_create_debugfs_file(struct gfs2_sbd *sdp); | 241 | extern void gfs2_unregister_debugfs(void); |
242 | void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp); | ||
243 | int gfs2_register_debugfs(void); | ||
244 | void gfs2_unregister_debugfs(void); | ||
245 | 242 | ||
246 | extern const struct lm_lockops gfs2_dlm_ops; | 243 | extern const struct lm_lockops gfs2_dlm_ops; |
247 | 244 | ||