@@ -41,38 +41,37 @@ shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O
4141operations. The glocks are basically a lock plus some routines which deal
4242with cache management. The following rules apply for the cache:
4343
44- ========== ========== ============== ========== ==============
45- Glock mode Cache data Cache Metadata Dirty Data Dirty Metadata
46- ========== ========== ============== ========== ==============
47- UN No No No No
48- SH Yes Yes No No
49- DF No Yes No No
50- EX Yes Yes Yes Yes
51- ========== ========== ============== ========== ==============
44+ ========== ============== ========== ========== ==============
45+ Glock mode Cache Metadata Cache data Dirty Data Dirty Metadata
46+ ========== ============== ========== ========== ==============
47+ UN No No No No
48+ DF Yes No No No
49+ SH Yes Yes No No
50+ EX Yes Yes Yes Yes
51+ ========== ============== ========== ========== ==============
5252
5353These rules are implemented using the various glock operations which
5454are defined for each type of glock. Not all types of glocks use
5555all the modes. Only inode glocks use the DF mode for example.
5656
5757Table of glock operations and per type constants:
5858
59- ============= =============================================================
59+ ============== =============================================================
6060Field Purpose
61- ============= =============================================================
62- go_xmote_th Called before remote state change (e.g. to sync dirty data)
61+ ============== =============================================================
62+ go_sync Called before remote state change (e.g. to sync dirty data)
6363go_xmote_bh Called after remote state change (e.g. to refill cache)
6464go_inval Called if remote state change requires invalidating the cache
65- go_demote_ok Returns boolean value of whether its ok to demote a glock
66- (e.g. checks timeout, and that there is no cached data)
67- go_lock Called for the first local holder of a lock
68- go_unlock Called on the final local unlock of a lock
65+ go_instantiate Called when a glock has been acquired
66+ go_held Called every time a glock holder is acquired
6967go_dump Called to print content of object for debugfs file, or on
7068 error to dump glock to the log.
71- go_type The type of the glock, ``LM_TYPE_* ``
7269go_callback Called if the DLM sends a callback to drop this lock
70+ go_unlocked Called when a glock is unlocked (dlm_unlock())
71+ go_type The type of the glock, ``LM_TYPE_* ``
7372go_flags GLOF_ASPACE is set, if the glock has an address space
7473 associated with it
75- ============= =============================================================
74+ ============== =============================================================
7675
7776The minimum hold time for each lock is the time after a remote lock
7877grant for which we ignore remote demote requests. This is in order to
@@ -83,26 +82,24 @@ to by multiple nodes. By delaying the demotion in response to a
8382remote callback, that gives the userspace program time to make
8483some progress before the pages are unmapped.
8584
86- There is a plan to try and remove the go_lock and go_unlock callbacks
87- if possible, in order to try and speed up the fast path though the locking.
88- Also, eventually we hope to make the glock "EX" mode locally shared
89- such that any local locking will be done with the i_mutex as required
90- rather than via the glock.
85+ Eventually, we hope to make the glock "EX" mode locally shared such that any
86+ local locking will be done with the i_mutex as required rather than via the
87+ glock.
9188
9289Locking rules for glock operations:
9390
94- ============= ====================== =============================
91+ ============== ====================== =============================
9592Operation GLF_LOCK bit lock held gl_lockref.lock spinlock held
96- ============= ====================== =============================
97- go_xmote_th Yes No
93+ ============== ====================== =============================
94+ go_sync Yes No
9895go_xmote_bh Yes No
9996go_inval Yes No
100- go_demote_ok Sometimes Yes
101- go_lock Yes No
102- go_unlock Yes No
97+ go_instantiate No No
98+ go_held No No
10399go_dump Sometimes Yes
104100go_callback Sometimes (N/A) Yes
105- ============= ====================== =============================
101+ go_unlocked Yes No
102+ ============== ====================== =============================
106103
107104.. Note ::
108105
0 commit comments