summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2015-06-12 20:15:54 +0200
committerBob Peterson <rpeterso@redhat.com>2015-06-18 19:17:59 +0200
commite7ccaf5fe1590667b3fa2f8df5c5ec9ba0dc5b85 (patch)
tree168c1f810fac94f8696fa491bee923e42d1677b7 /fs/gfs2/glock.c
parentgfs2: Don't support fallocate on jdata files (diff)
downloadlinux-e7ccaf5fe1590667b3fa2f8df5c5ec9ba0dc5b85.tar.xz
linux-e7ccaf5fe1590667b3fa2f8df5c5ec9ba0dc5b85.zip
GFS2: Don't add all glocks to the lru
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>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 0fa8062f85a7..a38e38f7b6fc 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -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);