Commit a3730c5e authored by Andreas Gruenbacher's avatar Andreas Gruenbacher

gfs2: Unlock fewer glocks on unmount

At unmount time, we would generally like to explicitly unlock as few
glocks as possible for efficiency.  We are already skipping glocks that
don't have a lock value block (LVB), but we can also skip glocks which
are not held in DLM_LOCK_EX or DLM_LOCK_PW mode (of which gfs2 only uses
DLM_LOCK_EX under the name LM_ST_EXCLUSIVE).
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
Cc: David Teigland <teigland@redhat.com>
parent d98779e6
......@@ -316,10 +316,16 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
gfs2_glock_free(gl);
return;
}
/* don't want to skip dlm_unlock writing the lvb when lock has one */
/*
* When the lockspace is released, all remaining glocks will be
* unlocked automatically. This is more efficient than unlocking them
* individually, but when the lock is held in DLM_LOCK_EX or
* DLM_LOCK_PW mode, the lock value block (LVB) will be lost.
*/
if (test_bit(SDF_SKIP_DLM_UNLOCK, &sdp->sd_flags) &&
!gl->gl_lksb.sb_lvbptr) {
(!gl->gl_lksb.sb_lvbptr || gl->gl_state != LM_ST_EXCLUSIVE)) {
gfs2_glock_free_later(gl);
return;
}
......
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