Whamcloud - gitweb
LU-1715 ptlrpc: flock deadlock detection does not work
[fs/lustre-release.git] / contrib / bit-masks / lustre_dlm_flags.def
1 AutoGen Definitions lustre_dlm_flags.tpl;
2
3 flag[ 0] = {
4     f-name  = lock_changed;
5     f-mask  = on_wire;
6     f-desc  = 'extent, mode, or resource changed';
7 };
8
9 flag[ 1] = {
10     f-name  = block_granted;
11     f-mask  = on_wire, blocked;
12     f-desc  = 'Server placed lock on granted list, or a recovering client wants '
13               'the lock added to the granted list, no questions asked.';
14 };
15
16 flag[ 2] = {
17     f-name  = block_conv;
18     f-mask  = on_wire, blocked;
19     f-desc  = <<- _EOF_
20         Server placed lock on conv list, or a recovering client wants the lock
21         added to the conv list, no questions asked.
22         _EOF_;
23 };
24
25 flag[ 3] = {
26     f-name  = block_wait;
27     f-mask  = on_wire, blocked;
28     f-desc  = <<- _EOF_
29         Server placed lock on wait list, or a recovering client wants
30         the lock added to the wait list, no questions asked.
31         _EOF_;
32 };
33
34 // Skipped bit 4
35
36 flag[ 5] = {
37     f-name  = ast_sent;
38     f-mask  = on_wire;
39     f-desc  = 'blocking or cancel packet was queued for sending.';
40 };
41
42 // Skipped bits 6 and 7
43
44 flag[ 8] = {
45     f-name  = replay;
46     f-mask  = on_wire;
47     f-desc  = <<- _EOF_
48         Lock is being replayed.  This could probably be implied by the fact that
49         one of BLOCK_{GRANTED,CONV,WAIT} is set, but that is pretty dangerous.
50         _EOF_;
51 };
52
53 flag[ 9] = {
54     f-name  = intent_only;
55     f-mask  = on_wire;
56     f-desc  = "Don't grant lock, just do intent.";
57 };
58
59 // Skipped bits 10 and 11
60
61 flag[12] = {
62     f-name  = has_intent;
63     f-mask  = on_wire;
64     f-desc  = 'lock request has intent';
65 };
66
67 // Skipped bits 13, 14
68
69 flag[15] = {
70     f-name  = flock_deadlock;
71     f-mask  = on_wire, ast;
72     f-desc  = 'flock deadlock detected';
73 };
74
75 flag[16] = {
76     f-name  = discard_data;
77     f-mask  = on_wire;
78     f-desc  = 'discard (no writeback) on cancel';
79 };
80
81 flag[17] = {
82     f-name  = no_timeout;
83     f-mask  = on_wire;
84     f-desc  = 'Blocked by group lock - wait indefinitely';
85 };
86
87 flag[18] = {
88     f-name  = block_nowait;
89     f-mask  = on_wire;
90     f-desc  = <<- _EOF_
91         Server told not to wait if blocked. For AGL, OST will not send
92         glimpse callback.
93         _EOF_;
94 };
95
96 flag[19] = {
97     f-name  = test_lock;
98     f-mask  = on_wire;
99     f-desc  = 'return blocking lock';
100 };
101
102 // Skipped bits 20, 21, and 22
103
104 flag[23] = {
105     f-name  = cancel_on_block;
106     f-mask  = on_wire, inherit;
107     f-desc  = <<- _EOF_
108         Immediatelly cancel such locks when they block some other locks. Send
109         cancel notification to original lock holder, but expect no reply. This is
110         for clients (like liblustre) that cannot be expected to reliably response
111         to blocking AST.
112         _EOF_;
113 };
114
115 // Skipped bits 24 through 29
116
117 flag[30] = {
118     f-name  = deny_on_contention;
119     f-mask  = on_wire;
120     f-desc  = 'measure lock contention and return -EUSERS if locking contention '
121               'is high';
122 };
123
124 flag[31] = {
125     f-name  = ast_discard_data;
126     f-mask  = on_wire, ast;
127     f-desc  = <<- _EOF_
128         These are flags that are mapped into the flags and ASTs of blocking locks
129         Add FL_DISCARD to blocking ASTs
130         _EOF_;
131 };
132
133 flag[32] = {
134     f-name  = fail_loc;
135     f-mask  = local_only;
136     f-desc  = <<- _EOF_
137         Used for marking lock as a target for -EINTR while cp_ast sleep
138         emulation + race with upcoming bl_ast.
139         _EOF_;
140 };
141
142 flag[33] = {
143     f-name  = skipped;
144     f-mask  = local_only;
145     f-desc  = <<- _EOF_
146         Used while processing the unused list to know that we have already
147         handled this lock and decided to skip it.
148         _EOF_;
149 };
150
151
152 flag[34] = {
153     f-name  = cbpending;
154     f-mask  = local_only, hide_lock;
155     f-desc  = 'this lock is being destroyed';
156 };
157
158 flag[35] = {
159     f-name  = wait_noreproc;
160     f-mask  = local_only;
161     f-desc  = 'not a real flag, not saved in lock';
162 };
163
164 flag[36] = {
165     f-name  = cancel;
166     f-mask  = local_only;
167     f-desc  = 'cancellation callback already run';
168 };
169
170 flag[37] = {
171     f-name  = local_only;
172     f-mask  = local_only, hide_lock;
173     f-desc  = 'whatever it might mean';
174 };
175
176 flag[38] = {
177     f-name  = failed;
178     f-mask  = local_only, gone, hide_lock;
179     f-desc  = "don't run the cancel callback under ldlm_cli_cancel_unused";
180 };
181
182 flag[39] = {
183     f-name  = canceling;
184     f-mask  = local_only;
185     f-desc  = 'lock cancel has already been sent';
186 };
187
188 flag[40] = {
189     f-name  = local;
190     f-mask  = local_only;
191     f-desc  = 'local lock (ie, no srv/cli split)';
192 };
193
194 flag[41] = {
195     f-name  = lvb_ready;
196     f-mask  = local_only;
197     f-desc  = <<- _EOF_
198         XXX FIXME: This is being added to b_size as a low-risk fix to the
199         fact that the LVB filling happens _after_ the lock has been granted,
200         so another thread can match it before the LVB has been updated.  As
201         a dirty hack, we set LDLM_FL_LVB_READY only after we've done the LVB
202         poop.  this is only needed on LOV/OSC now, where LVB is actually
203         used and callers must set it in input flags.
204
205         The proper fix is to do the granting inside of the completion AST,
206         which can be replaced with a LVB-aware wrapping function for OSC
207         locks.  That change is pretty high-risk, though, and would need a
208         lot more testing.
209         _EOF_;
210 };
211
212 flag[42] = {
213     f-name  = kms_ignore;
214     f-mask  = local_only;
215     f-desc  = <<- _EOF_
216         A lock contributes to the known minimum size (KMS) calculation until
217         it has finished the part of its cancelation that performs write back
218         on its dirty pages.  It can remain on the granted list during this
219         whole time.  Threads racing to update the KMS after performing their
220         writeback need to know to exclude each other's locks from the
221         calculation as they walk the granted list.
222         _EOF_;
223 };
224
225 flag[43] = {
226     f-name  = cp_reqd;
227     f-mask  = local_only;
228     f-desc  = 'completion AST to be executed';
229 };
230
231 flag[44] = {
232     f-name  = cleaned;
233     f-mask  = local_only;
234     f-desc  = 'cleanup_resource has already handled the lock';
235 };
236
237 flag[45] = {
238     f-name  = atomic_cb;
239     f-mask  = local_only, hide_lock;
240     f-desc  = <<- _EOF_
241         optimization hint: LDLM can run blocking callback from current context
242         w/o involving separate thread. in order to decrease cs rate
243         _EOF_;
244 };
245
246 flag[46] = {
247     f-name  = bl_ast;
248     f-mask  = local_only;
249     f-desc  = <<- _EOF_
250         It may happen that a client initiates two operations, e.g. unlink
251         and mkdir, such that the server sends a blocking AST for conflicting
252         locks to this client for the first operation, whereas the second
253         operation has canceled this lock and is waiting for rpc_lock which
254         is taken by the first operation. LDLM_FL_BL_AST is set by
255         ldlm_callback_handler() in the lock to prevent the Early Lock Cancel
256         (ELC) code from cancelling it.
257
258         LDLM_FL_BL_DONE is to be set by ldlm_cancel_callback() when lock
259         cache is dropped to let ldlm_callback_handler() return EINVAL to the
260         server. It is used when ELC RPC is already prepared and is waiting
261         for rpc_lock, too late to send a separate CANCEL RPC.
262         _EOF_;
263 };
264
265 flag[47] = {
266     f-name  = bl_done;
267     f-mask  = local_only;
268     f-desc  = 'whatever it might mean';
269 };
270
271 flag[48] = {
272     f-name  = no_lru;
273     f-mask  = local_only;
274     f-desc  = <<- _EOF_
275         Don't put lock into the LRU list, so that it is not canceled due to
276         aging.  Used by MGC locks, they are cancelled only at unmount or by
277         callback.
278         _EOF_;
279 };
280
281 flag[49] = {
282     f-name  = fail_notified;
283     f-mask  = local_only, gone;
284     f-desc  = <<- _EOF_
285         Set for locks that failed and where the server has been notified.
286
287         Protected by lock and resource locks.
288         _EOF_;
289 };
290
291 flag[50] = {
292     f-name  = destroyed;
293     f-mask  = local_only, gone;
294     f-desc  = <<- _EOF_
295         Set for locks that were removed from class hash table and will be
296         destroyed when last reference to them is released. Set by
297         ldlm_lock_destroy_internal().
298
299         Protected by lock and resource locks.
300         _EOF_;
301 };
302
303 flag[51] = {
304     f-name  = server_lock;
305     f-mask  = local_only;
306     f-desc  = 'flag whether this is a server namespace lock';
307 };
308
309 flag[52] = {
310     f-name  = res_locked;
311     f-mask  = local_only;
312     f-desc  = <<- _EOF_
313         It's set in lock_res_and_lock() and unset in unlock_res_and_lock().
314
315         NB: compared with check_res_locked(), checking this bit is cheaper.
316         Also, spin_is_locked() is deprecated for kernel code; one reason is
317         because it works only for SMP so user needs to add extra macros like
318         LASSERT_SPIN_LOCKED for uniprocessor kernels.
319         _EOF_;
320 };
321
322 flag[53] = {
323     f-name  = waited;
324     f-mask  = local_only;
325     f-desc  = <<- _EOF_
326         It's set once we call ldlm_add_waiting_lock_res_locked()
327         to start the lock-timeout timer and it will never be reset.
328
329         Protected by lock and resource locks.
330         _EOF_;
331 };
332
333 flag[54] = {
334     f-name  = ns_srv;
335     f-mask  = local_only;
336     f-desc  = 'Flag whether this is a server namespace lock.';
337 };
338
339 flag[55] = {
340     f-name  = excl;
341     f-mask  = local_only;
342     f-desc  = 'Flag whether this lock can be reused. Used by exclusive open.';
343 };