[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] GFS2: Don't use trylocks when converting dlm locks

There is no need to use a try lock when up converting a dlm lock because
the dlm will return -EDEADLK if the conversion would otherwise result in
a deadlock. GFS2 can already handle the -EDEADLK return on conversion.

This should make GFS2 a bit more efficient when it comes to locking
during contention situations, although tests haven't shown any
measurable improvement so far. Also this is a clean up of the code.

Signed-off-by: Steven Whitehouse <swhiteho redhat com>

diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 8777885..41fea85 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -590,10 +590,6 @@ __acquires(&gl->gl_spin)
 	clear_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags);
-	if (target != LM_ST_UNLOCKED && (gl->gl_state == LM_ST_SHARED ||
-	    gl->gl_state == LM_ST_DEFERRED) &&
-	    !(lck_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)))
-		lck_flags |= LM_FLAG_TRY_1CB;
 	ret = gfs2_lm_lock(sdp, gl, target, lck_flags);
 	if (!(ret & LM_OUT_ASYNC)) {

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]