diff options
author | Samuel Just <sjust@redhat.com> | 2024-10-03 03:26:04 +0200 |
---|---|---|
committer | Samuel Just <sjust@redhat.com> | 2024-11-07 19:29:42 +0100 |
commit | 737676bdb5c4c2b234e23399d23a74f029460b63 (patch) | |
tree | 6a826ee38e7a9d125e3a5d082fd5ebbbf84970c5 /src | |
parent | crimson: remove ObjectContextLoader::reload_obc (diff) | |
download | ceph-737676bdb5c4c2b234e23399d23a74f029460b63.tar.xz ceph-737676bdb5c4c2b234e23399d23a74f029460b63.zip |
crimson: track obcs unconditionally
Previously, we only interrupted head obcs. I don't think that
distinction actually makes sense -- both head and clone obcs
can have ops blocked on the lock. Let's just track them all.
Signed-off-by: Samuel Just <sjust@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/crimson/osd/object_context_loader.cc | 18 | ||||
-rw-r--r-- | src/crimson/osd/object_context_loader.h | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/crimson/osd/object_context_loader.cc b/src/crimson/osd/object_context_loader.cc index 1aa77b5a803..d2585c312ef 100644 --- a/src/crimson/osd/object_context_loader.cc +++ b/src/crimson/osd/object_context_loader.cc @@ -13,7 +13,7 @@ using crimson::common::local_conf; ObjectContextLoader::with_head_obc(const hobject_t& oid, with_obc_func_t&& func) { - return with_locked_obc<State, true /* track */>( + return with_locked_obc<State>( oid, [func=std::move(func)](auto obc) { // The template with_obc_func_t wrapper supports two obcs (head and clone). @@ -73,7 +73,7 @@ using crimson::common::local_conf; } clone_oid = *resolved_oid; } - return with_locked_obc<State, false /* don't track */>( + return with_locked_obc<State>( clone_oid, [head=std::move(head), func=std::move(func)](auto clone) { clone->set_clone_ssc(head->ssc); @@ -94,7 +94,7 @@ using crimson::common::local_conf; } } - template<RWState::State State, bool track, typename Func> + template<RWState::State State, typename Func> ObjectContextLoader::load_obc_iertr::future<> ObjectContextLoader::with_locked_obc(const hobject_t& oid, Func&& func) @@ -103,9 +103,7 @@ using crimson::common::local_conf; auto [obc, existed] = obc_registry.get_cached_obc(oid); DEBUGDPP("object {} existed {}", dpp, obc->get_oid(), existed); - if constexpr (track) { - obc->append_to(obc_set_accessing); - } + obc->append_to(obc_set_accessing); if (existed) { return obc->with_lock<State, IOInterruptCondition>( [func=std::move(func), obc=ObjectContextRef(obc)] { @@ -113,9 +111,7 @@ using crimson::common::local_conf; } ).finally([FNAME, this, obc=ObjectContextRef(obc)] { DEBUGDPP("released object {}, {}", dpp, obc->get_oid(), obc->obs); - if constexpr (track) { - obc->remove_from(obc_set_accessing); - } + obc->remove_from(obc_set_accessing); }); } else { return obc->load_then_with_lock<State> ( @@ -127,9 +123,7 @@ using crimson::common::local_conf; } ).finally([FNAME, this, obc=ObjectContextRef(obc)] { DEBUGDPP("released object {}, {}", dpp, obc->get_oid(), obc->obs); - if constexpr (track) { - obc->remove_from(obc_set_accessing); - } + obc->remove_from(obc_set_accessing); }); } } diff --git a/src/crimson/osd/object_context_loader.h b/src/crimson/osd/object_context_loader.h index 3a4381405fc..a16123e8b81 100644 --- a/src/crimson/osd/object_context_loader.h +++ b/src/crimson/osd/object_context_loader.h @@ -73,7 +73,7 @@ private: load_obc_iertr::future<> with_head_obc(const hobject_t& oid, with_obc_func_t&& func); - template<RWState::State State, bool track, typename Func> + template<RWState::State State, typename Func> load_obc_iertr::future<> with_locked_obc(const hobject_t& oid, Func&& func); |