From: Radoslaw Zarzynski Date: Wed, 21 May 2025 14:38:40 +0000 (+0000) Subject: crimson/osd: settle ECExtentCache within ShardService X-Git-Tag: v21.0.0~3^2~24 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=24c29ee70ce7040e9d747e17e506026bfefae909;p=ceph.git crimson/osd: settle ECExtentCache within ShardService Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/crimson/osd/shard_services.cc b/src/crimson/osd/shard_services.cc index a2eeeeb7eb09..3780cd626c64 100644 --- a/src/crimson/osd/shard_services.cc +++ b/src/crimson/osd/shard_services.cc @@ -50,7 +50,8 @@ PerShardState::PerShardState( // ids generated by different shards are disjoint static_cast(seastar::this_shard_id()) << (std::numeric_limits::digits - 8)), - startup_time(startup_time) + startup_time(startup_time), + ec_extent_cache_lru(crimson::common::local_conf().get_val("ec_extent_cache_size")) {} seastar::future<> PerShardState::dump_ops_in_flight(Formatter *f) const diff --git a/src/crimson/osd/shard_services.h b/src/crimson/osd/shard_services.h index b1fb5fb29902..19717ee55ef1 100644 --- a/src/crimson/osd/shard_services.h +++ b/src/crimson/osd/shard_services.h @@ -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 m_perf_queries; std::map 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)