* [Cluster-devel] [GFS2 PATCH] GFS2: Don't delay TRY locks
@ 2012-10-17 17:37 Bob Peterson
0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2012-10-17 17:37 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
This patch changes the glock minimum hold time down to zero if
the glock is a "try" lock.
Regards,
Bob Peterson
Red Hat File Systems
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 3f1df8b..98ae8a2 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -1289,6 +1289,7 @@ void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state)
unsigned long delay = 0;
unsigned long holdtime;
unsigned long now = jiffies;
+ const struct gfs2_holder *gh_head;
gfs2_glock_hold(gl);
holdtime = gl->gl_tchange + gl->gl_hold_time;
@@ -1301,6 +1302,12 @@ void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state)
}
spin_lock(&gl->gl_spin);
+ if (!list_empty(&gl->gl_holders)) {
+ gh_head = list_entry(gl->gl_holders.next,
+ const struct gfs2_holder, gh_list);
+ if (gh_head->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))
+ delay = 0;
+ }
handle_callback(gl, state, delay);
spin_unlock(&gl->gl_spin);
if (queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-10-17 17:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-17 17:37 [Cluster-devel] [GFS2 PATCH] GFS2: Don't delay TRY locks Bob Peterson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.