From: Xuehan Xu Date: Thu, 6 Mar 2025 08:29:54 +0000 (+0800) Subject: crimson/os/seastore/linked_tree_node: move "account_absent_access()" out X-Git-Tag: v20.3.0~79^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9828cbed2024df6347eeafe19f4f400081983077;p=ceph.git crimson/os/seastore/linked_tree_node: move "account_absent_access()" out of ExtentTransViewRetriever Signed-off-by: Xuehan Xu --- diff --git a/src/crimson/os/seastore/btree/fixed_kv_btree.h b/src/crimson/os/seastore/btree/fixed_kv_btree.h index a635407dcadb8..b3270a94b6cd1 100644 --- a/src/crimson/os/seastore/btree/fixed_kv_btree.h +++ b/src/crimson/os/seastore/btree/fixed_kv_btree.h @@ -1503,6 +1503,7 @@ private: return on_found(child->template cast()); }); } + c.cache.account_absent_access(c.trans.get_src()); auto child_pos = v.get_child_pos(); auto next_iter = node_iter + 1; @@ -1574,6 +1575,7 @@ private: return on_found(child->template cast()); }); } + c.cache.account_absent_access(c.trans.get_src()); auto child_pos = v.get_child_pos(); auto next_iter = node_iter + 1; @@ -2133,6 +2135,7 @@ private: return do_merge(child->template cast()); }); } + c.cache.account_absent_access(c.trans.get_src()); auto child_pos = v.get_child_pos(); return get_node( diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 0041d7b6d6988..8e597cafd1160 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -186,7 +186,7 @@ public: return t.root; } - void account_absent_access(Transaction::src_t src) final { + void account_absent_access(Transaction::src_t src) { ++(get_by_src(stats.cache_absent_by_src, src)); ++stats.access.cache_absent; } diff --git a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc index a14e18a56c214..5dbbbaf8a9fda 100644 --- a/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc +++ b/src/crimson/os/seastore/lba_manager/btree/btree_lba_manager.cc @@ -103,6 +103,7 @@ BtreeLBAMapping::get_logical_extent(Transaction &t) : get_key(); auto v = p.template get_child(ctx.trans, ctx.cache, pos, k); if (!v.has_child()) { + ctx.cache.account_absent_access(ctx.trans.get_src()); this->child_pos = v.get_child_pos(); } return v; diff --git a/src/crimson/os/seastore/linked_tree_node.h b/src/crimson/os/seastore/linked_tree_node.h index 572b7e1ccfcb5..013f401cc4a5f 100644 --- a/src/crimson/os/seastore/linked_tree_node.h +++ b/src/crimson/os/seastore/linked_tree_node.h @@ -250,7 +250,6 @@ public: return ext->template cast(); }); } - virtual void account_absent_access(Transaction::src_t) = 0; virtual bool is_viewable_extent_data_stable(Transaction &, CachedExtentRef) = 0; virtual bool is_viewable_extent_stable(Transaction &, CachedExtentRef) = 0; virtual ~ExtentTransViewRetriever() {} @@ -350,11 +349,9 @@ public: return etvr.get_extent_viewable_by_trans( t, static_cast(child)); } else { - etvr.account_absent_access(t.get_src()); return child_pos_t(&sparent, spos); } } else { - etvr.account_absent_access(t.get_src()); return child_pos_t(&me, pos); } }