]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/osd: settle ECExtentCache within ShardService
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 21 May 2025 14:38:40 +0000 (14:38 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 27 Jan 2026 19:42:59 +0000 (19:42 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/shard_services.cc
src/crimson/osd/shard_services.h

index ae73c2c9f13ac1a8519ef665e96ec04861e53034..a1467693da07df44c8de2428a6599e59d9f195c6 100644 (file)
@@ -50,7 +50,8 @@ PerShardState::PerShardState(
       // ids generated by different shards are disjoint
       static_cast<ceph_tid_t>(seastar::this_shard_id()) <<
       (std::numeric_limits<ceph_tid_t>::digits - 8)),
-    startup_time(startup_time)
+    startup_time(startup_time),
+    ec_extent_cache_lru(crimson::common::local_conf().get_val<uint64_t>("ec_extent_cache_size"))
 {}
 
 seastar::future<> PerShardState::dump_ops_in_flight(Formatter *f) const
index 2df9b47e4947c376a38ec5db24b008741279167e..4ec298f2b390d4bd443555dd3ab021423a7e2cec 100644 (file)
@@ -27,6 +27,7 @@
 #include "common/AsyncReserver.h"
 #include "crimson/net/Connection.h"
 #include "mgr/OSDPerfMetricTypes.h"
+#include "osd/ECExtentCache.h"
 
 namespace crimson::net {
   class Messenger;
@@ -208,6 +209,11 @@ class PerShardState {
   std::list<OSDPerfMetricQuery> m_perf_queries;
   std::map<OSDPerfMetricQuery, OSDPerfMetricLimits> m_perf_limits;
 
+  // This is an extent cache for the erasure coding. Specifically, this acts as
+  // a least-recently-used cache invalidator, allowing for cache shards to last
+  // longer than the most recent IO in each object.
+  ECExtentCache::LRU ec_extent_cache_lru;
+
 public:
   PerShardState(
     int whoami,
@@ -626,6 +632,10 @@ public:
       });
   }
 
+  ECExtentCache::LRU &lookup_ec_extent_cache_lru() {
+    return local_state.ec_extent_cache_lru;
+  }
+
   FORWARD_TO_OSD_SINGLETON(get_pool_info)
   FORWARD(get_throttle, get_throttle, local_state.throttler)