Whamcloud - gitweb
LU-2826 tests: Re-enable sanity/18
[fs/lustre-release.git] / lustre / doc / lock-ordering
1 /* this is dot(1) input file for lock-ordering diagram */
2 /* it should be passed through C preprocessor first */
3 /* cpp -P -DFITPAGE lock-ordering | tred | dot -Tps | gv -media a4 - */
4
5 /*
6 sb->s_umount
7     libcfs_nidstring_lock
8     obd_dev_lock
9     g_uuid_lock
10     obd_types_lock
11     type->obd_type_lock
12     obd->obd_dev_lock
13     handle_base_lock
14     bucket->lock
15     _lprocfs_lock
16     the_lnet.ln_lock
17         request->rq_lock
18     ptlrpc_all_services_lock
19     service->srv_lock
20     shrinker_rwsem
21     conn_lock
22         hash_body->lchb_hash_tables[i].lhb_lock
23     hash_body->lchb_hash_tables[i].lhb_lock
24     imp->imp_lock
25     olg->olg_lock
26     cli->cl_sem
27         handle_base_lock
28         bucket->lock
29         obd->obd_dev_lock
30             ref->lf_guard
31             hash_body->lchb_hash_tables[i].lhb_lock
32         h->h_lock
33         _lprocfs_lock
34         imp->imp_lock
35             h->h_lock
36         policy_lock
37         null_sec.ps_lock
38         ptlrpc_last_xid_lock
39         set->set_new_req_lock
40     h->h_lock
41     ns->ns_hash_lock
42     ns->ns_unused_lock
43     lock->l_lock
44     null_sec.ps_lock
45     ptlrpc_last_xid_lock
46     request->rq_lock
47     ksocknal_data.ksnd_global_lock
48     at->at_lock
49     fld->lcf_lock
50     obd->obd_pool_lock
51     obd->obd_osfs_lock
52     lov->lov_qos.lq_rw_sem
53     sbi->ll_lco.lco_lock
54     cache->fci_lock
55     inode_lock
56     dcache_lock
57         dentry->d_lock
58 slock-AF_INET/1
59     ksocknal_data.ksnd_global_lock
60         ksocknal_data.ksnd_connd_lock
61         kss->kss_lock
62 pl->pl_lock
63     obd->obd_pool_lock
64 inode->i_mutex
65     ns->ns_unused_lock
66     ns->ns_hash_lock
67     imp->imp_lock
68     null_sec.ps_lock
69     ptlrpc_last_xid_lock
70     bucket->lock
71     lock->l_lock
72         res->lr_lock
73             ns->ns_unused_lock
74             bucket->lock
75                 h->h_lock
76             res->lr_lock/1
77             inode_lock
78             osc_ast_guard_class
79                 ref->lf_guard
80     ksocknal_data.ksnd_global_lock
81     at->at_lock
82     h->h_lock
83     blp->blp_lock
84     cache->fci_lock
85     obd->obd_pool_lock
86     fld->lcf_lock
87     pl->pl_lock
88     lu_site_guard_class
89     files_lock
90 lov->lo_type_guard
91     h->coh_lock_guard
92     ref->lf_guard
93     cl_lock_guard_class
94         ref->lf_guard
95         cl_lock_guard_class#2
96             cl_lock_guard_class#2
97             ref->lf_guard
98             ns->ns_hash_lock
99             ns->ns_unused_lock
100             imp->imp_lock
101             null_sec.ps_lock
102             ptlrpc_last_xid_lock
103             handle_base_lock
104             bucket->lock
105             lock->l_lock
106             set->set_new_req_lock
107             h->h_lock
108         h->coh_lock_guard
109         h->coh_page_guard
110
111 */
112 #define CATTR fontsize=8 /*, fontname=Helvetica */
113 #define NATTR CATTR
114 #define EATTR CATTR
115
116 #define SYSATTR color=yellow, style=filled
117 #define PSEUDOATTR color=pink, style=filled, peripheries=2
118
119 #define BLOCKATTR shape=ellipse
120 #define SPINATTR shape=box
121
122 #define CONDATTR color=blue, peripheries=2, BLOCKATTR
123
124 #define MARKBLOCK(name) /* name -> schedulable [style=invis, weight=0] */
125
126 #define SBLOCK(name, l) name [label=l, NATTR, BLOCKATTR, SYSATTR]; MARKBLOCK(name)
127
128 #define SPSEUDO(name) name [NATTR, BLOCKATTR, PSEUDOATTR]; MARKBLOCK(name)
129
130 #define LBLOCK(name, l) name [label=l, NATTR, BLOCKATTR]; MARKBLOCK(name)
131
132 #define RCOND(name, l) name [label=l, NATTR, CONDATTR]; MARKBLOCK(name)
133
134 #define MARKSPIN(name) /* schedulable -> name [style=invis, weight=0] */
135
136 #define SSPIN(name, l) name [label=l, NATTR, SYSATTR, SPINATTR]; MARKSPIN(name)
137 #define LSPIN(name, l) name [label=l, NATTR, SPINATTR]; MARKSPIN(name)
138
139 #define ARC(from, to, func, ...) from -> to [EATTR, label=func, ## __VA_ARGS__]
140
141 digraph locks {
142
143     subgraph blocking {
144         SBLOCK(sb__s_umount, "sb->s_umount")
145         LBLOCK(_lprocfs_lock, "_lprocfs_lock")
146         LBLOCK(cli__cl_sem, "cli->cl_sem")
147         SBLOCK(shrinker_rwsem, "shrinker_rwsem")
148         LBLOCK(lov__lov_qos_lq_rw_sem, "lov->lov_qos.lq_rw_sem")
149         SBLOCK(inode__i_mutex, "inode->i_mutex")
150         LBLOCK(lov__lo_type_guard, "lov->lo_type_guard")
151         LBLOCK(cl_lock_guard_class, "cl_lock_guard_class")
152     }
153
154     subgraph spin {
155         LSPIN(h__coh_lock_guard, "h->coh_lock_guard")
156         LSPIN(h__coh_page_guard, "h->coh_page_guard")
157         LSPIN(libcfs_nidstring_lock, "libcfs_nidstring_lock")
158         LSPIN(obd_dev_lock, "obd_dev_lock")
159         LSPIN(g_uuid_lock, "g_uuid_lock")
160         LSPIN(obd_types_lock, "obd_types_lock")
161         LSPIN(obd_type__obd_type_lock, "obd_type->obd_type_lock")
162         LSPIN(obd__obd_dev_lock, "obd->obd_dev_lock")
163         LSPIN(handle_base_lock, "handle_base_lock")
164         LSPIN(bucket__lock, "bucket->lock")
165         LSPIN(the_lnet_ln_lock, "the_lnet.ln_lock")
166         LSPIN(request__rq_lock, "request->rq_lock")
167         LSPIN(hash_body__lchb_hash_tables_i__lhb_lock, "hash_body->lchb_hash_tables[i].lhb_lock")
168         LSPIN(imp__imp_lock, "imp->imp_lock")
169         LSPIN(ref__lf_guard, "ref->lf_guard")
170         LSPIN(h__h_lock, "h->h_lock")
171         LSPIN(null_sec_ps_lock, "null_sec.ps_lock")
172         LSPIN(set__set_new_req_lock, "set->set_new_req_lock")
173         LSPIN(ns__ns_hash_lock, "ns->ns_hash_lock")
174         LSPIN(ns__ns_unused_lock, "ns->ns_unused_lock")
175         LSPIN(lock__l_lock, "lock->l_lock")
176         LSPIN(ksocknal_data_ksnd_global_lock, "ksocknal_data.ksnd_global_lock")
177         LSPIN(at__at_lock, "at->at_lock")
178         LSPIN(fld__lcf_lock, "fld->lcf_lock")
179         LSPIN(obd__obd_pool_lock, "obd->obd_pool_lock")
180         LSPIN(service__srv_lock, "service->srv_lock")
181         LSPIN(obd__obd_osfs_lock, "obd->obd_osfs_lock")
182         LSPIN(sbi__ll_lco_lco_lock, "sbi->ll_lco.lco_lock")
183         LSPIN(cache__fci_lock, "cache->fci_lock")
184         SSPIN(inode_lock, "inode_lock")
185         SSPIN(dcache_lock, "dcache_lock")
186         SSPIN(dentry__d_lock, "dentry->d_lock")
187         LSPIN(ksocknal_data_ksnd_connd_lock, "ksocknal_data.ksnd_connd_lock")
188         LSPIN(kss__kss_lock, "kss->kss_lock")
189         LSPIN(pl__pl_lock, "pl->pl_lock")
190         LSPIN(osc_ast_guard_class, "osc_ast_guard_class")
191         LSPIN(blp__blp_lock, "blp->blp_lock")
192         LSPIN(lu_site_guard_class, "lu_site_guard_class")
193         SSPIN(files_lock, "files_lock")
194         LSPIN(ptlrpc_all_services_lock, "ptlrpc_all_services_lock")
195         LSPIN(conn_lock, "conn_lock")
196         LSPIN(olg__olg_lock, "olg->olg_lock")
197         LSPIN(policy_lock, "policy_lock")
198         LSPIN(ptlrpc_last_xid_lock, "ptlrpc_last_xid_lock")
199     }
200
201 ARC(sb__s_umount, libcfs_nidstring_lock, "")
202 ARC(sb__s_umount, obd_dev_lock, "")
203 ARC(sb__s_umount, g_uuid_lock, "")
204 ARC(sb__s_umount, obd_types_lock, "")
205 ARC(sb__s_umount, type__obd_type_lock, "")
206 ARC(sb__s_umount, obd__obd_dev_lock, "")
207 ARC(sb__s_umount, handle_base_lock, "")
208 ARC(sb__s_umount, bucket__lock, "")
209 ARC(sb__s_umount, _lprocfs_lock, "")
210 ARC(sb__s_umount, the_lnet_ln_lock, "")
211 ARC(sb__s_umount, ptlrpc_all_services_lock, "")
212 ARC(sb__s_umount, service__srv_lock, "")
213 ARC(sb__s_umount, shrinker_rwsem, "")
214 ARC(sb__s_umount, conn_lock, "")
215 ARC(sb__s_umount, hash_body__lchb_hash_tables_i__lhb_lock, "")
216 ARC(sb__s_umount, imp__imp_lock, "")
217 ARC(sb__s_umount, olg__olg_lock, "")
218 ARC(sb__s_umount, cli__cl_sem, "")
219 ARC(sb__s_umount, h__h_lock, "")
220 ARC(sb__s_umount, ns__ns_hash_lock, "")
221 ARC(sb__s_umount, ns__ns_unused_lock, "")
222 ARC(sb__s_umount, lock__l_lock, "")
223 ARC(sb__s_umount, null_sec_ps_lock, "")
224 ARC(sb__s_umount, ptlrpc_last_xid_lock, "")
225 ARC(sb__s_umount, request__rq_lock, "")
226 ARC(sb__s_umount, ksocknal_data_ksnd_global_lock, "")
227 ARC(sb__s_umount, at__at_lock, "")
228 ARC(sb__s_umount, fld__lcf_lock, "")
229 ARC(sb__s_umount, obd__obd_pool_lock, "")
230 ARC(sb__s_umount, obd__obd_osfs_lock, "")
231 ARC(sb__s_umount, lov__lov_qos_lq_rw_sem, "")
232 ARC(sb__s_umount, sbi__ll_lco_lco_lock, "")
233 ARC(sb__s_umount, cache__fci_lock, "")
234 ARC(sb__s_umount, inode_lock, "")
235 ARC(sb__s_umount, dcache_lock, "")
236
237 ARC(the_lnet_ln_lock, request__rq_lock, "")
238 ARC(conn_lock, hash_body__lchb_hash_tables_i__lhb_lock, "")
239 ARC(cli__cl_sem, handle_base_lock, "")
240 ARC(cli__cl_sem, bucket__lock, "")
241 ARC(cli__cl_sem, obd__obd_dev_lock, "")
242 ARC(cli__cl_sem, h__h_lock, "")
243 ARC(cli__cl_sem, _lprocfs_lock, "")
244 ARC(cli__cl_sem, imp__imp_lock, "")
245 ARC(cli__cl_sem, policy_lock, "")
246 ARC(cli__cl_sem, null_sec_ps_lock, "")
247 ARC(cli__cl_sem, ptlrpc_last_xid_lock, "")
248 ARC(cli__cl_sem, set__set_new_req_lock, "")
249
250 ARC(obd__obd_dev_lock, ref__lf_guard, "")
251 ARC(obd__obd_dev_lock, hash_body__lchb_hash_tables_i__lhb_lock, "")
252 ARC(imp__imp_lock, h__h_lock, "")
253
254 ARC(dcache_lock, dentry__d_lock, "")
255
256 ARC(ksocknal_data_ksnd_global_lock, ksocknal_data_ksnd_connd_lock, "")
257 ARC(ksocknal_data_ksnd_global_lock, kss__kss_lock, "")
258 ARC(pl__pl_lock, obd__obd_pool_lock, "")
259
260 ARC(inode__i_mutex, ns__ns_unused_lock, "")
261 ARC(inode__i_mutex, ns__ns_hash_lock, "")
262 ARC(inode__i_mutex, imp__imp_lock, "")
263 ARC(inode__i_mutex, null_sec_ps_lock, "")
264 ARC(inode__i_mutex, ptlrpc_last_xid_lock, "")
265 ARC(inode__i_mutex, bucket__lock, "")
266 ARC(inode__i_mutex, lock__l_lock, "")
267 ARC(inode__i_mutex, ksocknal_data_ksnd_global_lock, "")
268 ARC(inode__i_mutex, at__at_lock, "")
269 ARC(inode__i_mutex, h__h_lock, "")
270 ARC(inode__i_mutex, blp__blp_lock, "")
271 ARC(inode__i_mutex, cache__fci_lock, "")
272 ARC(inode__i_mutex, obd__obd_pool_lock, "")
273 ARC(inode__i_mutex, fld__lcf_lock, "")
274 ARC(inode__i_mutex, pl__pl_lock, "")
275 ARC(inode__i_mutex, lu_site_guard_class, "")
276 ARC(inode__i_mutex, files_lock, "")
277
278 ARC(lock__l_lock, res__lr_lock, "")
279 ARC(res__lr_lock, ns__ns_unused_lock, "")
280 ARC(res__lr_lock, bucket__lock, "")
281 ARC(res__lr_lock, res__lr_lock, "")
282 ARC(res__lr_lock, inode_lock, "")
283 ARC(res__lr_lock, osc_ast_guard_class, "")
284
285 ARC(osc_ast_guard_class, ref__lf_guard, "")
286 ARC(bucket__lock, h__h_lock, "")
287
288 ARC(cl_lock_guard_class, cl_lock_guard_class, "")
289 ARC(cl_lock_guard_class, ref__lf_guard, "")
290 ARC(cl_lock_guard_class, ns__ns_hash_lock, "")
291 ARC(cl_lock_guard_class, ns__ns_unused_lock, "")
292 ARC(cl_lock_guard_class, imp__imp_lock, "")
293 ARC(cl_lock_guard_class, null_sec_ps_lock, "")
294 ARC(cl_lock_guard_class, ptlrpc_last_xid_lock, "")
295 ARC(cl_lock_guard_class, handle_base_lock, "")
296 ARC(cl_lock_guard_class, bucket__lock, "")
297 ARC(cl_lock_guard_class, lock__l_lock, "")
298 ARC(cl_lock_guard_class, set__set_new_req_lock, "")
299 ARC(cl_lock_guard_class, h__h_lock, "")
300 ARC(cl_lock_guard_class, ref__lf_guard, "")
301 ARC(cl_lock_guard_class, cl_lock_guard_class, "")
302 ARC(cl_lock_guard_class, h__coh_lock_guard, "")
303 ARC(cl_lock_guard_class, h__coh_page_guard, "")
304
305 ARC(lov__lo_type_guard, h__coh_lock_guard, "")
306 ARC(lov__lo_type_guard, ref__lf_guard, "")
307 ARC(lov__lo_type_guard, cl_lock_guard_class, "")
308
309 }