From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 PATCH] GFS2: Don't delay TRY locks
Date: Wed, 17 Oct 2012 13:37:49 -0400 (EDT) [thread overview]
Message-ID: <895494729.19792440.1350495469476.JavaMail.root@redhat.com> (raw)
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)
reply other threads:[~2012-10-17 17:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=895494729.19792440.1350495469476.JavaMail.root@redhat.com \
--to=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.