|
|
21ab4e |
From 582ab3b5292701242ee2259c5abc8dfe741d59f9 Mon Sep 17 00:00:00 2001
|
|
|
21ab4e |
From: Poornima G <pgurusid@redhat.com>
|
|
|
21ab4e |
Date: Tue, 25 Apr 2017 15:04:34 +0530
|
|
|
21ab4e |
Subject: [PATCH 436/473] nl-cache: Fix the issue in refd_inode counting and
|
|
|
21ab4e |
prune the cache
|
|
|
21ab4e |
|
|
|
21ab4e |
>Reviewed-on: https://review.gluster.org/17110
|
|
|
21ab4e |
>Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
21ab4e |
>Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
21ab4e |
>Smoke: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
|
|
21ab4e |
>Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
|
|
21ab4e |
>Signed-off-by: Poornima G <pgurusid@redhat.com>
|
|
|
21ab4e |
|
|
|
21ab4e |
Change-Id: I5b9beb8502667bc3876385900bc01b6491348716
|
|
|
21ab4e |
BUG: 1450330
|
|
|
21ab4e |
Signed-off-by: Poornima G <pgurusid@redhat.com>
|
|
|
21ab4e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/106135
|
|
|
21ab4e |
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
|
|
21ab4e |
---
|
|
|
21ab4e |
xlators/performance/nl-cache/src/nl-cache-helper.c | 8 +++++---
|
|
|
21ab4e |
xlators/performance/nl-cache/src/nl-cache.c | 8 +++++---
|
|
|
21ab4e |
xlators/performance/nl-cache/src/nl-cache.h | 3 +++
|
|
|
21ab4e |
3 files changed, 13 insertions(+), 6 deletions(-)
|
|
|
21ab4e |
|
|
|
21ab4e |
diff --git a/xlators/performance/nl-cache/src/nl-cache-helper.c b/xlators/performance/nl-cache/src/nl-cache-helper.c
|
|
|
21ab4e |
index 34438ed..edc8c16 100644
|
|
|
21ab4e |
--- a/xlators/performance/nl-cache/src/nl-cache-helper.c
|
|
|
21ab4e |
+++ b/xlators/performance/nl-cache/src/nl-cache-helper.c
|
|
|
21ab4e |
@@ -558,13 +558,13 @@ __nlc_free_pe (xlator_t *this, nlc_ctx_t *nlc_ctx, nlc_pe_t *pe)
|
|
|
21ab4e |
{
|
|
|
21ab4e |
uint64_t pe_int = 0;
|
|
|
21ab4e |
nlc_conf_t *conf = NULL;
|
|
|
21ab4e |
- uint64_t *nlc_ctx_int = NULL;
|
|
|
21ab4e |
+ uint64_t nlc_ctx_int = 0;
|
|
|
21ab4e |
|
|
|
21ab4e |
conf = this->private;
|
|
|
21ab4e |
|
|
|
21ab4e |
if (pe->inode) {
|
|
|
21ab4e |
inode_ctx_reset1 (pe->inode, this, &pe_int);
|
|
|
21ab4e |
- inode_ctx_get2 (pe->inode, this, nlc_ctx_int, NULL);
|
|
|
21ab4e |
+ inode_ctx_get2 (pe->inode, this, &nlc_ctx_int, NULL);
|
|
|
21ab4e |
inode_unref (pe->inode);
|
|
|
21ab4e |
}
|
|
|
21ab4e |
list_del (&pe->list);
|
|
|
21ab4e |
@@ -1118,6 +1118,8 @@ nlc_dump_inodectx (xlator_t *this, inode_t *inode)
|
|
|
21ab4e |
gf_proc_dump_write ("state", "%"PRIu64, nlc_ctx->state);
|
|
|
21ab4e |
gf_proc_dump_write ("timer", "%p", nlc_ctx->timer);
|
|
|
21ab4e |
gf_proc_dump_write ("cache-time", "%lld", nlc_ctx->cache_time);
|
|
|
21ab4e |
+ gf_proc_dump_write ("cache-size", "%zu", nlc_ctx->cache_size);
|
|
|
21ab4e |
+ gf_proc_dump_write ("refd-inodes", "%"PRIu64, nlc_ctx->refd_inodes);
|
|
|
21ab4e |
|
|
|
21ab4e |
if (IS_PE_VALID (nlc_ctx->state))
|
|
|
21ab4e |
list_for_each_entry_safe (pe, tmp, &nlc_ctx->pe, list) {
|
|
|
21ab4e |
@@ -1130,7 +1132,7 @@ nlc_dump_inodectx (xlator_t *this, inode_t *inode)
|
|
|
21ab4e |
gf_proc_dump_write ("ne", "%s", ne->name);
|
|
|
21ab4e |
}
|
|
|
21ab4e |
|
|
|
21ab4e |
- UNLOCK (&nlc_ctx->lock);
|
|
|
21ab4e |
+ UNLOCK (&nlc_ctx->lock);
|
|
|
21ab4e |
}
|
|
|
21ab4e |
|
|
|
21ab4e |
if (ret && nlc_ctx)
|
|
|
21ab4e |
diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c
|
|
|
21ab4e |
index 08e7d9e..675b5de 100644
|
|
|
21ab4e |
--- a/xlators/performance/nl-cache/src/nl-cache.c
|
|
|
21ab4e |
+++ b/xlators/performance/nl-cache/src/nl-cache.c
|
|
|
21ab4e |
@@ -54,6 +54,8 @@ nlc_dentry_op (call_frame_t *frame, xlator_t *this, gf_boolean_t multilink)
|
|
|
21ab4e |
default:
|
|
|
21ab4e |
return;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
+
|
|
|
21ab4e |
+ nlc_lru_prune (this, NULL);
|
|
|
21ab4e |
out:
|
|
|
21ab4e |
return;
|
|
|
21ab4e |
}
|
|
|
21ab4e |
@@ -766,10 +768,10 @@ struct volume_options options[] = {
|
|
|
21ab4e |
"a while and the cache is cleared based on LRU",
|
|
|
21ab4e |
},
|
|
|
21ab4e |
{ .key = {"nl-cache-timeout"},
|
|
|
21ab4e |
- .type = GF_OPTION_TYPE_INT,
|
|
|
21ab4e |
+ .type = GF_OPTION_TYPE_TIME,
|
|
|
21ab4e |
.min = 0,
|
|
|
21ab4e |
- .max = 600,
|
|
|
21ab4e |
- .default_value = "600",
|
|
|
21ab4e |
+ .max = 1 * GF_DAY_IN_SECONDS,
|
|
|
21ab4e |
+ .default_value = "60",
|
|
|
21ab4e |
.description = "Time period after which cache has to be refreshed",
|
|
|
21ab4e |
},
|
|
|
21ab4e |
{ .key = {NULL} },
|
|
|
21ab4e |
diff --git a/xlators/performance/nl-cache/src/nl-cache.h b/xlators/performance/nl-cache/src/nl-cache.h
|
|
|
21ab4e |
index e94641c..10ec022 100644
|
|
|
21ab4e |
--- a/xlators/performance/nl-cache/src/nl-cache.h
|
|
|
21ab4e |
+++ b/xlators/performance/nl-cache/src/nl-cache.h
|
|
|
21ab4e |
@@ -170,4 +170,7 @@ nlc_clear_all_cache (xlator_t *this);
|
|
|
21ab4e |
void
|
|
|
21ab4e |
nlc_disable_cache (xlator_t *this);
|
|
|
21ab4e |
|
|
|
21ab4e |
+void
|
|
|
21ab4e |
+nlc_lru_prune (xlator_t *this, inode_t *inode);
|
|
|
21ab4e |
+
|
|
|
21ab4e |
#endif /* __NL_CACHE_H__ */
|
|
|
21ab4e |
--
|
|
|
21ab4e |
1.8.3.1
|
|
|
21ab4e |
|