Skip to content

Commit 84fb640

Browse files
committed
Merge PR ceph#62698 into main
* refs/pull/62698/head: mds: add some perf counters about cache trimming Reviewed-by: Kotresh Hiremath Ravishankar <[email protected]> Reviewed-by: Venky Shankar <[email protected]>
2 parents 1dede9d + a8b12bb commit 84fb640

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

src/mds/MDCache.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6998,7 +6998,12 @@ std::pair<bool, uint64_t> MDCache::trim_lru(uint64_t count, expiremap& expiremap
69986998
bool throttled = false;
69996999
while (1) {
70007000
throttled |= trim_counter_start+trimmed >= trim_threshold;
7001-
if (throttled) break;
7001+
if (throttled) {
7002+
if (logger) {
7003+
logger->inc(l_mdss_cache_trim_throttle);
7004+
}
7005+
break;
7006+
}
70027007
CDentry *dn = static_cast<CDentry*>(bottom_lru.lru_expire());
70037008
if (!dn)
70047009
break;
@@ -7024,7 +7029,12 @@ std::pair<bool, uint64_t> MDCache::trim_lru(uint64_t count, expiremap& expiremap
70247029
// trim dentries from the LRU until count is reached
70257030
while (!throttled && (cache_toofull() || count > 0)) {
70267031
throttled |= trim_counter_start+trimmed >= trim_threshold;
7027-
if (throttled) break;
7032+
if (throttled) {
7033+
if (logger) {
7034+
logger->inc(l_mdss_cache_trim_throttle);
7035+
}
7036+
break;
7037+
}
70287038
CDentry *dn = static_cast<CDentry*>(lru.lru_expire());
70297039
if (!dn) {
70307040
break;

src/mds/Server.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ void Server::create_logger()
192192
PerfCountersBuilder::PRIO_INTERESTING);
193193
plb.add_u64_counter(l_mdss_cap_revoke_eviction, "cap_revoke_eviction",
194194
"Cap Revoke Client Eviction", "cre", PerfCountersBuilder::PRIO_INTERESTING);
195+
plb.add_u64_counter(l_mdss_cache_trim_throttle, "cache_trim_throttle",
196+
"Cache trim throttle counter", "ctt", PerfCountersBuilder::PRIO_INTERESTING);
197+
plb.add_u64_counter(l_mdss_session_recall_throttle, "session_recall_throttle",
198+
"Session recall throttle counter", "srt", PerfCountersBuilder::PRIO_INTERESTING);
199+
plb.add_u64_counter(l_mdss_session_recall_throttle2o, "session_recall_throttle2o",
200+
"Session recall throttle2o counter", "srt2", PerfCountersBuilder::PRIO_INTERESTING);
201+
plb.add_u64_counter(l_mdss_global_recall_throttle, "global_recall_throttle",
202+
"Global recall throttle counter", "grt", PerfCountersBuilder::PRIO_INTERESTING);
195203
plb.add_u64_counter(l_mdss_cap_acquisition_throttle,
196204
"cap_acquisition_throttle", "Cap acquisition throttle counter", "cat",
197205
PerfCountersBuilder::PRIO_INTERESTING);
@@ -2002,14 +2010,23 @@ std::pair<bool, uint64_t> Server::recall_client_state(MDSGatherBuilder* gather,
20022010
const uint64_t global_recall_throttle = recall_throttle.get();
20032011
if (session_recall_throttle+recall > recall_max_decay_threshold) {
20042012
dout(15) << " session recall threshold (" << recall_max_decay_threshold << ") hit at " << session_recall_throttle << "; skipping!" << dendl;
2013+
if (logger) {
2014+
logger->inc(l_mdss_session_recall_throttle);
2015+
}
20052016
throttled = true;
20062017
continue;
20072018
} else if (session_recall_throttle2o+recall > recall_max_caps*2) {
20082019
dout(15) << " session recall 2nd-order threshold (" << 2*recall_max_caps << ") hit at " << session_recall_throttle2o << "; skipping!" << dendl;
2020+
if (logger) {
2021+
logger->inc(l_mdss_session_recall_throttle2o);
2022+
}
20092023
throttled = true;
20102024
continue;
20112025
} else if (global_recall_throttle+recall > recall_global_max_decay_threshold) {
20122026
dout(15) << " global recall threshold (" << recall_global_max_decay_threshold << ") hit at " << global_recall_throttle << "; skipping!" << dendl;
2027+
if (logger) {
2028+
logger->inc(l_mdss_global_recall_throttle);
2029+
}
20132030
throttled = true;
20142031
break;
20152032
}

src/mds/Server.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ enum {
117117
l_mdss_req_symlink_latency,
118118
l_mdss_req_unlink_latency,
119119
l_mdss_cap_revoke_eviction,
120+
l_mdss_cache_trim_throttle,
121+
l_mdss_session_recall_throttle,
122+
l_mdss_session_recall_throttle2o,
123+
l_mdss_global_recall_throttle,
120124
l_mdss_cap_acquisition_throttle,
121125
l_mdss_req_getvxattr_latency,
122126
l_mdss_req_file_blockdiff_latency,

0 commit comments

Comments
 (0)