summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/main.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-11-04 05:15:08 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2013-11-04 06:17:49 -0500
commit2147dbfd059eb7fefcfd5934f74f25f0693d4a1f (patch)
tree8cc89a827bcc48f529698bef65eb61216562425a /fs/gfs2/main.c
parent7d80823e1d83e35977d77ae201bf63af3317ad0a (diff)
GFS2: Use generic list_lru for quota
By using the generic list_lru code, we can now separate the per sb quota list locking from the lru locking. The lru lock is made into the inner-most lock. As a result of this new lock order, we may occasionally see items on the per-sb quota list which are "dead" so that the two places where we traverse that list are updated to take account of that. As a result of this patch, the gfs2 quota shrinker is now NUMA zone aware, and we are also laying the foundations for further improvments in due course. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Abhijith Das <adas@redhat.com> Tested-by: Abhijith Das <adas@redhat.com> Cc: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/gfs2/main.c')
-rw-r--r--fs/gfs2/main.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 351586e24e30..0650db2541ef 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -31,12 +31,6 @@
31 31
32struct workqueue_struct *gfs2_control_wq; 32struct workqueue_struct *gfs2_control_wq;
33 33
34static struct shrinker qd_shrinker = {
35 .count_objects = gfs2_qd_shrink_count,
36 .scan_objects = gfs2_qd_shrink_scan,
37 .seeks = DEFAULT_SEEKS,
38};
39
40static void gfs2_init_inode_once(void *foo) 34static void gfs2_init_inode_once(void *foo)
41{ 35{
42 struct gfs2_inode *ip = foo; 36 struct gfs2_inode *ip = foo;
@@ -87,6 +81,10 @@ static int __init init_gfs2_fs(void)
87 if (error) 81 if (error)
88 return error; 82 return error;
89 83
84 error = list_lru_init(&gfs2_qd_lru);
85 if (error)
86 goto fail_lru;
87
90 error = gfs2_glock_init(); 88 error = gfs2_glock_init();
91 if (error) 89 if (error)
92 goto fail; 90 goto fail;
@@ -139,7 +137,7 @@ static int __init init_gfs2_fs(void)
139 if (!gfs2_rsrv_cachep) 137 if (!gfs2_rsrv_cachep)
140 goto fail; 138 goto fail;
141 139
142 register_shrinker(&qd_shrinker); 140 register_shrinker(&gfs2_qd_shrinker);
143 141
144 error = register_filesystem(&gfs2_fs_type); 142 error = register_filesystem(&gfs2_fs_type);
145 if (error) 143 if (error)
@@ -179,7 +177,9 @@ fail_wq:
179fail_unregister: 177fail_unregister:
180 unregister_filesystem(&gfs2_fs_type); 178 unregister_filesystem(&gfs2_fs_type);
181fail: 179fail:
182 unregister_shrinker(&qd_shrinker); 180 list_lru_destroy(&gfs2_qd_lru);
181fail_lru:
182 unregister_shrinker(&gfs2_qd_shrinker);
183 gfs2_glock_exit(); 183 gfs2_glock_exit();
184 184
185 if (gfs2_rsrv_cachep) 185 if (gfs2_rsrv_cachep)
@@ -214,13 +214,14 @@ fail:
214 214
215static void __exit exit_gfs2_fs(void) 215static void __exit exit_gfs2_fs(void)
216{ 216{
217 unregister_shrinker(&qd_shrinker); 217 unregister_shrinker(&gfs2_qd_shrinker);
218 gfs2_glock_exit(); 218 gfs2_glock_exit();
219 gfs2_unregister_debugfs(); 219 gfs2_unregister_debugfs();
220 unregister_filesystem(&gfs2_fs_type); 220 unregister_filesystem(&gfs2_fs_type);
221 unregister_filesystem(&gfs2meta_fs_type); 221 unregister_filesystem(&gfs2meta_fs_type);
222 destroy_workqueue(gfs_recovery_wq); 222 destroy_workqueue(gfs_recovery_wq);
223 destroy_workqueue(gfs2_control_wq); 223 destroy_workqueue(gfs2_control_wq);
224 list_lru_destroy(&gfs2_qd_lru);
224 225
225 rcu_barrier(); 226 rcu_barrier();
226 227