From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bob Peterson Date: Wed, 17 Oct 2012 13:37:49 -0400 (EDT) Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Don't delay TRY locks Message-ID: <895494729.19792440.1350495469476.JavaMail.root@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- 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)