From: Yingxin Cheng Date: Wed, 16 Apr 2025 02:21:22 +0000 (+0800) Subject: crimson/os/seastore/cache: minor adjustments to the calling order X-Git-Tag: v20.3.0~7^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a622de21c29525cb47845e31ecb716c81a9adc11;p=ceph.git crimson/os/seastore/cache: minor adjustments to the calling order Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/os/seastore/cache.h b/src/crimson/os/seastore/cache.h index 9eef19fc48f8..3e8f2fba83f9 100644 --- a/src/crimson/os/seastore/cache.h +++ b/src/crimson/os/seastore/cache.h @@ -212,6 +212,15 @@ public: t, type, paddr, len); return get_extent_if_cached_iertr::make_ready_future(); } else if (result == Transaction::get_extent_ret::PRESENT) { + if (ret->get_length() != len) { + SUBDEBUGT(seastore_cache, + "{} {}~0x{:x} is present on t with inconsistent length 0x{:x} -- {}", + t, type, paddr, len, ret->get_length(), *ret); + return get_extent_if_cached_iertr::make_ready_future(); + } + + ceph_assert(ret->get_type() == type); + if (ret->is_stable()) { if (ret->is_dirty()) { ++access_stats.trans_dirty; @@ -225,14 +234,6 @@ public: ++stats.access.trans_pending; } - if (ret->get_length() != len) { - SUBDEBUGT(seastore_cache, - "{} {}~0x{:x} is present on t with inconsistent length 0x{:x} -- {}", - t, type, paddr, len, ret->get_length(), *ret); - return get_extent_if_cached_iertr::make_ready_future(); - } - - ceph_assert(ret->get_type() == type); if (!ret->is_fully_loaded()) { SUBDEBUGT(seastore_cache, "{} {}~0x{:x} is present on t without fully loaded -- {}", @@ -267,14 +268,6 @@ public: return get_extent_if_cached_iertr::make_ready_future(); } - if (ret->is_dirty()) { - ++access_stats.cache_dirty; - ++stats.access.cache_dirty; - } else { - ++access_stats.cache_lru; - ++stats.access.cache_lru; - } - if (ret->get_length() != len) { SUBDEBUGT(seastore_cache, "{} {}~0x{:x} is present in cache with inconsistent length 0x{:x} -- {}", @@ -283,6 +276,15 @@ public: } ceph_assert(ret->get_type() == type); + + if (ret->is_dirty()) { + ++access_stats.cache_dirty; + ++stats.access.cache_dirty; + } else { + ++access_stats.cache_lru; + ++stats.access.cache_lru; + } + t.add_to_read_set(ret); touch_extent(*ret, &t_src, t.get_cache_hint()); if (!ret->is_fully_loaded()) {