@@ -40,38 +40,39 @@ shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O
40
40
operations. The glocks are basically a lock plus some routines which deal
41
41
with cache management. The following rules apply for the cache:
42
42
43
- ========== ========== ============== ========== ==============
44
- Glock mode Cache data Cache Metadata Dirty Data Dirty Metadata
45
- ========== ========== ============== ========== ==============
46
- UN No No No No
47
- SH Yes Yes No No
48
- DF No Yes No No
49
- EX Yes Yes Yes Yes
50
- ========== ========== ============== ========== ==============
43
+ ========== ============== ========== ========== ==============
44
+ Glock mode Cache Metadata Cache data Dirty Data Dirty Metadata
45
+ ========== ============== ========== ========== ==============
46
+ UN No No No No
47
+ DF Yes No No No
48
+ SH Yes Yes No No
49
+ EX Yes Yes Yes Yes
50
+ ========== ============== ========== ========== ==============
51
51
52
52
These rules are implemented using the various glock operations which
53
53
are defined for each type of glock. Not all types of glocks use
54
54
all the modes. Only inode glocks use the DF mode for example.
55
55
56
56
Table of glock operations and per type constants:
57
57
58
- ============= =============================================================
58
+ ============== =============================================================
59
59
Field Purpose
60
- ============= =============================================================
61
- go_xmote_th Called before remote state change (e.g. to sync dirty data)
60
+ ============== =============================================================
61
+ go_sync Called before remote state change (e.g. to sync dirty data)
62
62
go_xmote_bh Called after remote state change (e.g. to refill cache)
63
63
go_inval Called if remote state change requires invalidating the cache
64
64
go_demote_ok Returns boolean value of whether its ok to demote a glock
65
65
(e.g. checks timeout, and that there is no cached data)
66
- go_lock Called for the first local holder of a lock
67
- go_unlock Called on the final local unlock of a lock
66
+ go_instantiate Called when a glock has been acquired
67
+ go_held Called every time a glock holder is acquired
68
68
go_dump Called to print content of object for debugfs file, or on
69
69
error to dump glock to the log.
70
- go_type The type of the glock, ``LM_TYPE_* ``
71
70
go_callback Called if the DLM sends a callback to drop this lock
71
+ go_unlocked Called when a glock is unlocked (dlm_unlock())
72
+ go_type The type of the glock, ``LM_TYPE_* ``
72
73
go_flags GLOF_ASPACE is set, if the glock has an address space
73
74
associated with it
74
- ============= =============================================================
75
+ ============== =============================================================
75
76
76
77
The minimum hold time for each lock is the time after a remote lock
77
78
grant for which we ignore remote demote requests. This is in order to
@@ -82,26 +83,25 @@ to by multiple nodes. By delaying the demotion in response to a
82
83
remote callback, that gives the userspace program time to make
83
84
some progress before the pages are unmapped.
84
85
85
- There is a plan to try and remove the go_lock and go_unlock callbacks
86
- if possible, in order to try and speed up the fast path though the locking.
87
- Also, eventually we hope to make the glock "EX" mode locally shared
88
- such that any local locking will be done with the i_mutex as required
89
- rather than via the glock.
86
+ Eventually, we hope to make the glock "EX" mode locally shared such that any
87
+ local locking will be done with the i_mutex as required rather than via the
88
+ glock.
90
89
91
90
Locking rules for glock operations:
92
91
93
- ============= ====================== =============================
92
+ ============== ====================== =============================
94
93
Operation GLF_LOCK bit lock held gl_lockref.lock spinlock held
95
- ============= ====================== =============================
96
- go_xmote_th Yes No
94
+ ============== ====================== =============================
95
+ go_sync Yes No
97
96
go_xmote_bh Yes No
98
97
go_inval Yes No
99
98
go_demote_ok Sometimes Yes
100
- go_lock Yes No
101
- go_unlock Yes No
99
+ go_instantiate No No
100
+ go_held No No
102
101
go_dump Sometimes Yes
103
102
go_callback Sometimes (N/A) Yes
104
- ============= ====================== =============================
103
+ go_unlocked Yes No
104
+ ============== ====================== =============================
105
105
106
106
.. Note ::
107
107
0 commit comments