cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] [GFS2 PATCH] GFS2: Don't waste time locking lru_lock for non-lru glocks
       [not found] <842931352.34658265.1501085354071.JavaMail.zimbra@redhat.com>
@ 2017-07-26 16:10 ` Bob Peterson
  2017-07-26 16:11   ` Steven Whitehouse
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2017-07-26 16:10 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Before this patch, glock_dq would call gfs2_glock_remove_from_lru.
For glocks that are never put on the LRU, such as the transaction
glock, this just takes the spin_lock, determines there's nothing to
be done because the list is empty, then unlocks again. This was
causing unnecessary lock contention on the lru_lock spin_lock.
This patch adds a check for GLOF_LRU in the glops before taking
the spin_lock, thus reducing lru_lock contention.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index c38ab6c81898..1029340fc8ba 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -150,6 +150,9 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl)
 
 static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
 {
+	if (!(gl->gl_ops->go_flags & GLOF_LRU))
+		return;
+
 	spin_lock(&lru_lock);
 	if (!list_empty(&gl->gl_lru)) {
 		list_del_init(&gl->gl_lru);



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

* [Cluster-devel] [GFS2 PATCH] GFS2: Don't waste time locking lru_lock for non-lru glocks
  2017-07-26 16:10 ` [Cluster-devel] [GFS2 PATCH] GFS2: Don't waste time locking lru_lock for non-lru glocks Bob Peterson
@ 2017-07-26 16:11   ` Steven Whitehouse
  0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2017-07-26 16:11 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Looks good.

Acked-by: Steven Whitehouse <swhiteho@redhat.com>

Steve.


On 26/07/17 17:10, Bob Peterson wrote:
> Hi,
>
> Before this patch, glock_dq would call gfs2_glock_remove_from_lru.
> For glocks that are never put on the LRU, such as the transaction
> glock, this just takes the spin_lock, determines there's nothing to
> be done because the list is empty, then unlocks again. This was
> causing unnecessary lock contention on the lru_lock spin_lock.
> This patch adds a check for GLOF_LRU in the glops before taking
> the spin_lock, thus reducing lru_lock contention.
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
> index c38ab6c81898..1029340fc8ba 100644
> --- a/fs/gfs2/glock.c
> +++ b/fs/gfs2/glock.c
> @@ -150,6 +150,9 @@ void gfs2_glock_add_to_lru(struct gfs2_glock *gl)
>   
>   static void gfs2_glock_remove_from_lru(struct gfs2_glock *gl)
>   {
> +	if (!(gl->gl_ops->go_flags & GLOF_LRU))
> +		return;
> +
>   	spin_lock(&lru_lock);
>   	if (!list_empty(&gl->gl_lru)) {
>   		list_del_init(&gl->gl_lru);
>



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

end of thread, other threads:[~2017-07-26 16:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <842931352.34658265.1501085354071.JavaMail.zimbra@redhat.com>
2017-07-26 16:10 ` [Cluster-devel] [GFS2 PATCH] GFS2: Don't waste time locking lru_lock for non-lru glocks Bob Peterson
2017-07-26 16:11   ` Steven Whitehouse

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).