]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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, 24 Mar 2026 16:06:24 +0000 (16:06 +0000)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/osd/shard_services.cc
src/crimson/osd/shard_services.h

index a2eeeeb7eb09d29804253adb4e698f19090a268c..3780cd626c643f66af49661d9f61888e991e1222 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 b1fb5fb29902a95c3ee893b48d4c2140ed6b587d..19717ee55ef1d448eef2f5afe9be15cbdab5abfc 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,
@@ -640,6 +646,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)