Commit 97d6fdcd authored by Andreas Gruenbacher's avatar Andreas Gruenbacher

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: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent edeb180f
...@@ -40,14 +40,14 @@ shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O ...@@ -40,14 +40,14 @@ shared lock mode, SH. In GFS2 the DF mode is used exclusively for direct I/O
operations. The glocks are basically a lock plus some routines which deal operations. The glocks are basically a lock plus some routines which deal
with cache management. The following rules apply for the cache: with cache management. The following rules apply for the cache:
========== ========== ============== ========== ============== ========== ============== ========== ========== ==============
Glock mode Cache data Cache Metadata Dirty Data Dirty Metadata Glock mode Cache Metadata Cache data Dirty Data Dirty Metadata
========== ========== ============== ========== ============== ========== ============== ========== ========== ==============
UN No No No No UN No No No No
SH Yes Yes No No DF Yes No No No
DF No Yes No No SH Yes Yes No No
EX Yes Yes Yes Yes EX Yes Yes Yes Yes
========== ========== ============== ========== ============== ========== ============== ========== ========== ==============
These rules are implemented using the various glock operations which These rules are implemented using the various glock operations which
are defined for each type of glock. Not all types of glocks use are defined for each type of glock. Not all types of glocks use
...@@ -55,23 +55,24 @@ all the modes. Only inode glocks use the DF mode for example. ...@@ -55,23 +55,24 @@ all the modes. Only inode glocks use the DF mode for example.
Table of glock operations and per type constants: Table of glock operations and per type constants:
============= ============================================================= ============== =============================================================
Field Purpose Field Purpose
============= ============================================================= ============== =============================================================
go_xmote_th Called before remote state change (e.g. to sync dirty data) go_sync Called before remote state change (e.g. to sync dirty data)
go_xmote_bh Called after remote state change (e.g. to refill cache) go_xmote_bh Called after remote state change (e.g. to refill cache)
go_inval Called if remote state change requires invalidating the cache go_inval Called if remote state change requires invalidating the cache
go_demote_ok Returns boolean value of whether its ok to demote a glock go_demote_ok Returns boolean value of whether its ok to demote a glock
(e.g. checks timeout, and that there is no cached data) (e.g. checks timeout, and that there is no cached data)
go_lock Called for the first local holder of a lock go_instantiate Called when a glock has been acquired
go_unlock Called on the final local unlock of a lock go_held Called every time a glock holder is acquired
go_dump Called to print content of object for debugfs file, or on go_dump Called to print content of object for debugfs file, or on
error to dump glock to the log. error to dump glock to the log.
go_type The type of the glock, ``LM_TYPE_*``
go_callback Called if the DLM sends a callback to drop this lock go_callback Called if the DLM sends a callback to drop this lock
go_unlocked Called when a glock is unlocked (dlm_unlock())
go_type The type of the glock, ``LM_TYPE_*``
go_flags GLOF_ASPACE is set, if the glock has an address space go_flags GLOF_ASPACE is set, if the glock has an address space
associated with it associated with it
============= ============================================================= ============== =============================================================
The minimum hold time for each lock is the time after a remote lock The minimum hold time for each lock is the time after a remote lock
grant for which we ignore remote demote requests. This is in order to 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,26 +83,25 @@ to by multiple nodes. By delaying the demotion in response to a
remote callback, that gives the userspace program time to make remote callback, that gives the userspace program time to make
some progress before the pages are unmapped. some progress before the pages are unmapped.
There is a plan to try and remove the go_lock and go_unlock callbacks Eventually, we hope to make the glock "EX" mode locally shared such that any
if possible, in order to try and speed up the fast path though the locking. local locking will be done with the i_mutex as required rather than via the
Also, eventually we hope to make the glock "EX" mode locally shared glock.
such that any local locking will be done with the i_mutex as required
rather than via the glock.
Locking rules for glock operations: Locking rules for glock operations:
============= ====================== ============================= ============== ====================== =============================
Operation GLF_LOCK bit lock held gl_lockref.lock spinlock held Operation GLF_LOCK bit lock held gl_lockref.lock spinlock held
============= ====================== ============================= ============== ====================== =============================
go_xmote_th Yes No go_sync Yes No
go_xmote_bh Yes No go_xmote_bh Yes No
go_inval Yes No go_inval Yes No
go_demote_ok Sometimes Yes go_demote_ok Sometimes Yes
go_lock Yes No go_instantiate No No
go_unlock Yes No go_held No No
go_dump Sometimes Yes go_dump Sometimes Yes
go_callback Sometimes (N/A) Yes go_callback Sometimes (N/A) Yes
============= ====================== ============================= go_unlocked Yes No
============== ====================== =============================
.. Note:: .. Note::
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment