]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
GFS2: Don't add all glocks to the lru
authorBob Peterson <rpeterso@redhat.com>
Fri, 12 Jun 2015 18:15:54 +0000 (13:15 -0500)
committerBob Peterson <rpeterso@redhat.com>
Thu, 18 Jun 2015 17:17:59 +0000 (12:17 -0500)
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 adds a new bit in
the glops that determines which glock types get put onto the lru
list and which ones don't.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glock.c
fs/gfs2/glops.c
fs/gfs2/incore.h

index 0fa8062f85a7ab20332301ffafd1733940352096..a38e38f7b6fc37ae2e2b9ca5af0e59d7c5652856 100644 (file)
@@ -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) &&
+           (glops->go_flags & GLOF_LRU))
                gfs2_glock_add_to_lru(gl);
 
        trace_gfs2_glock_queue(gh, 0);
index fe91951c33617adbcae820f1cce048df84a254a8..1249b2bb2830eba9a2609c41389baa0a2338fd18 100644 (file)
@@ -561,7 +561,7 @@ const struct gfs2_glock_operations gfs2_inode_glops = {
        .go_lock = inode_go_lock,
        .go_dump = inode_go_dump,
        .go_type = LM_TYPE_INODE,
-       .go_flags = GLOF_ASPACE,
+       .go_flags = GLOF_ASPACE | GLOF_LRU,
 };
 
 const struct gfs2_glock_operations gfs2_rgrp_glops = {
@@ -584,10 +584,12 @@ const struct gfs2_glock_operations gfs2_freeze_glops = {
 const struct gfs2_glock_operations gfs2_iopen_glops = {
        .go_type = LM_TYPE_IOPEN,
        .go_callback = iopen_go_callback,
+       .go_flags = GLOF_LRU,
 };
 
 const struct gfs2_glock_operations gfs2_flock_glops = {
        .go_type = LM_TYPE_FLOCK,
+       .go_flags = GLOF_LRU,
 };
 
 const struct gfs2_glock_operations gfs2_nondisk_glops = {
@@ -596,7 +598,7 @@ const struct gfs2_glock_operations gfs2_nondisk_glops = {
 
 const struct gfs2_glock_operations gfs2_quota_glops = {
        .go_type = LM_TYPE_QUOTA,
-       .go_flags = GLOF_LVB,
+       .go_flags = GLOF_LVB | GLOF_LRU,
 };
 
 const struct gfs2_glock_operations gfs2_journal_glops = {
index 304a22315448890217fe58b3cd762ac070758f0b..a1ec7c20e498220c75809e14bae2c2d63709b9a8 100644 (file)
@@ -225,6 +225,7 @@ struct gfs2_glock_operations {
        const unsigned long go_flags;
 #define GLOF_ASPACE 1
 #define GLOF_LVB    2
+#define GLOF_LRU    4
 };
 
 enum {