Skip to contentSkip to conversation

GFS2: Don't add rgrp glocks to the lru

PATCH New Bob Peterson 2 participants 2 messages Jun 12, 2015 – Jun 15, 2015 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 GFS2: Don't add rgrp glocks to the lru

Hi,

The glocks used for resource groups often come and go hundreds of thousands of times per second. Adding them to the lru list just adds unnecessary contention for the lru_lock spin_lock, especially considering we're almost certainly going to re-use the glock and take it back off the lru microseconds later. We never want the glock shrinker to cull them anyway. This patch bypasses adding them to the lru.

Regards,

Bob Peterson
Red Hat File Systems

---

fs/gfs2/glock.c +2 -1
index 0fa8062..1db06a5 100644
@@ -1076,7 +1076,8 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
 		    !test_bit(GLF_DEMOTE, &gl->gl_flags))
 			fast_path = 1;
 	}
-	if (!test_bit(GLF_LFLUSH, &gl->gl_flags) && demote_ok(gl))
+	if (!test_bit(GLF_LFLUSH, &gl->gl_flags) && demote_ok(gl) &&
+	    gl->gl_name.ln_type != LM_TYPE_RGRP)
 		gfs2_glock_add_to_lru(gl);
 
 	trace_gfs2_glock_queue(gh, 0);
#2 lore raw

PATCH 1/1 GFS2: Don't add rgrp glocks to the lru

Hi,

Quoted 10 lines · Bob Peterson

Hi,

The glocks used for resource groups often come and go hundreds of thousands of times per second. Adding them to the lru list just adds unnecessary contention for the lru_lock spin_lock, especially considering we're almost certainly going to re-use the glock and take it back off the lru microseconds later. We never want the glock shrinker to cull them anyway. This patch bypasses adding them to the lru.

Quoted 6 lines

Regards,

Bob Peterson
Red Hat File Systems

Steve.

Quoted 16 lines

---

fs/gfs2/glock.c +2 -1
index 0fa8062..1db06a5 100644
@@ -1076,7 +1076,8 @@ void gfs2_glock_dq(struct gfs2_holder *gh)
  		    !test_bit(GLF_DEMOTE, &gl->gl_flags))
  			fast_path = 1;
  	}
-	if (!test_bit(GLF_LFLUSH, &gl->gl_flags) && demote_ok(gl))
+	if (!test_bit(GLF_LFLUSH, &gl->gl_flags) && demote_ok(gl) &&
+	    gl->gl_name.ln_type != LM_TYPE_RGRP)
  		gfs2_glock_add_to_lru(gl);
 
  	trace_gfs2_glock_queue(gh, 0);