Skip to content

Commit 97d6fdc

Browse files
author
Andreas Gruenbacher
committed
gfs2: Update glocks documentation
Rearrange the table of locking modes and associated caching capability to be in order of increasing caching capability. Update the description of the glock operations. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent edeb180 commit 97d6fdc

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

Documentation/filesystems/gfs2-glocks.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,39 @@ shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O
4040
operations. The glocks are basically a lock plus some routines which deal
4141
with cache management. The following rules apply for the cache:
4242

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+
========== ============== ========== ========== ==============
5151

5252
These rules are implemented using the various glock operations which
5353
are defined for each type of glock. Not all types of glocks use
5454
all the modes. Only inode glocks use the DF mode for example.
5555

5656
Table of glock operations and per type constants:
5757

58-
============= =============================================================
58+
============== =============================================================
5959
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)
6262
go_xmote_bh Called after remote state change (e.g. to refill cache)
6363
go_inval Called if remote state change requires invalidating the cache
6464
go_demote_ok Returns boolean value of whether its ok to demote a glock
6565
(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
6868
go_dump Called to print content of object for debugfs file, or on
6969
error to dump glock to the log.
70-
go_type The type of the glock, ``LM_TYPE_*``
7170
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_*``
7273
go_flags GLOF_ASPACE is set, if the glock has an address space
7374
associated with it
74-
============= =============================================================
75+
============== =============================================================
7576

7677
The minimum hold time for each lock is the time after a remote lock
7778
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
8283
remote callback, that gives the userspace program time to make
8384
some progress before the pages are unmapped.
8485

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.
9089

9190
Locking rules for glock operations:
9291

93-
============= ====================== =============================
92+
============== ====================== =============================
9493
Operation GLF_LOCK bit lock held gl_lockref.lock spinlock held
95-
============= ====================== =============================
96-
go_xmote_th Yes No
94+
============== ====================== =============================
95+
go_sync Yes No
9796
go_xmote_bh Yes No
9897
go_inval Yes No
9998
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
102101
go_dump Sometimes Yes
103102
go_callback Sometimes (N/A) Yes
104-
============= ====================== =============================
103+
go_unlocked Yes No
104+
============== ====================== =============================
105105

106106
.. Note::
107107

0 commit comments

Comments
 (0)