* [Cluster-devel] [GFS2 PATCH] GFS2: Don't add all glocks to the lru
[not found] <373060449.17748002.1434479153773.JavaMail.zimbra@redhat.com>
@ 2015-06-16 18:31 ` Bob Peterson
2015-06-18 16:49 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Bob Peterson @ 2015-06-16 18:31 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Regarding my previously posted patch:
I decided it makes more sense not to single out rgrp glocks for
exclusion from the lru list. It makes sense to also exclude the
transaction glock, and "non-disk" glocks off the lru list as well.
Therefore, I changed this to a generic "glops" flag so we could
specify them on an individual basis.
Patch description:
The glocks used for resource groups often come and go hundreds of
thousands of time 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.
Regards,
Bob Peterson
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 0fa8062..a38e38f 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);
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
index fe91951..1249b2b 100644
--- a/fs/gfs2/glops.c
+++ b/fs/gfs2/glops.c
@@ -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 = {
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 304a223..a1ec7c2 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -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 {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [GFS2 PATCH] GFS2: Don't add all glocks to the lru
2015-06-16 18:31 ` [Cluster-devel] [GFS2 PATCH] GFS2: Don't add all glocks to the lru Bob Peterson
@ 2015-06-18 16:49 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2015-06-18 16:49 UTC (permalink / raw)
To: cluster-devel.redhat.com
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Steve.
On 16/06/15 19:31, Bob Peterson wrote:
> Hi,
>
> Regarding my previously posted patch:
> I decided it makes more sense not to single out rgrp glocks for
> exclusion from the lru list. It makes sense to also exclude the
> transaction glock, and "non-disk" glocks off the lru list as well.
> Therefore, I changed this to a generic "glops" flag so we could
> specify them on an individual basis.
>
> Patch description:
>
> The glocks used for resource groups often come and go hundreds of
> thousands of time 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.
>
> Regards,
>
> Bob Peterson
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> ---
> diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
> index 0fa8062..a38e38f 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);
> diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c
> index fe91951..1249b2b 100644
> --- a/fs/gfs2/glops.c
> +++ b/fs/gfs2/glops.c
> @@ -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 = {
> diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
> index 304a223..a1ec7c2 100644
> --- a/fs/gfs2/incore.h
> +++ b/fs/gfs2/incore.h
> @@ -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 {
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-18 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <373060449.17748002.1434479153773.JavaMail.zimbra@redhat.com>
2015-06-16 18:31 ` [Cluster-devel] [GFS2 PATCH] GFS2: Don't add all glocks to the lru Bob Peterson
2015-06-18 16:49 ` Steven Whitehouse
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.