cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] GFS2: Don't use trylocks when converting dlm locks
@ 2010-10-21 10:07 Steven Whitehouse
  2010-10-21 16:31 ` Bob Peterson
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Whitehouse @ 2010-10-21 10:07 UTC (permalink / raw)
  To: cluster-devel.redhat.com


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);
 
 	gfs2_glock_hold(gl);
-	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)) {




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-21 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-21 10:07 [Cluster-devel] GFS2: Don't use trylocks when converting dlm locks Steven Whitehouse
2010-10-21 16:31 ` Bob Peterson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).