Skip to content

Commit b68b07a

Browse files
committed
Merge: gfs2: Revise glock reference counting model
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5784 JIRA: https://issues.redhat.com/browse/RHEL-67675 Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Approved-by: Abhi Das <adas@redhat.com> Approved-by: Andrew Price <anprice@redhat.com> Approved-by: Paul Evans <pevans@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents 3f05cd6 + acdf764 commit b68b07a

File tree

13 files changed

+243
-236
lines changed

13 files changed

+243
-236
lines changed

Documentation/filesystems/gfs2-glocks.rst

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,38 +41,37 @@ shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O
4141
operations. The glocks are basically a lock plus some routines which deal
4242
with 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

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

5757
Table of glock operations and per type constants:
5858

59-
============= =============================================================
59+
============== =============================================================
6060
Field 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)
6363
go_xmote_bh Called after remote state change (e.g. to refill cache)
6464
go_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
6967
go_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_*``
7269
go_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_*``
7372
go_flags GLOF_ASPACE is set, if the glock has an address space
7473
associated with it
75-
============= =============================================================
74+
============== =============================================================
7675

7776
The minimum hold time for each lock is the time after a remote lock
7877
grant 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
8382
remote callback, that gives the userspace program time to make
8483
some 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

9289
Locking rules for glock operations:
9390

94-
============= ====================== =============================
91+
============== ====================== =============================
9592
Operation GLF_LOCK bit lock held gl_lockref.lock spinlock held
96-
============= ====================== =============================
97-
go_xmote_th Yes No
93+
============== ====================== =============================
94+
go_sync Yes No
9895
go_xmote_bh Yes No
9996
go_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
10399
go_dump Sometimes Yes
104100
go_callback Sometimes (N/A) Yes
105-
============= ====================== =============================
101+
go_unlocked Yes No
102+
============== ====================== =============================
106103

107104
.. Note::
108105

0 commit comments

Comments
 (0)