]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/onode_manager: avoid debug related info from 69095/head
authorXuehan Xu <xuxuehan@qianxin.com>
Tue, 26 May 2026 09:55:00 +0000 (17:55 +0800)
committerXuehan Xu <xuxuehan@qianxin.com>
Tue, 26 May 2026 09:55:00 +0000 (17:55 +0800)
occupying too much cpu time

According to the perf tests, constructing the info occupies about 5% of
the total system cpu overhead

Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/crimson/os/seastore/onode_manager/staged-fltree/node.cc
src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h

index b83831f5a3fa7a0ad8b982990732cf71cdf630e9..809d91cc5ff3faee94d1c8f7a53fd3e810af554b 100644 (file)
@@ -690,20 +690,25 @@ eagain_ifuture<Ref<Node>> Node::load(
   return c.nm.read_extent(c.t, addr
   ).handle_error_interruptible(
     eagain_iertr::pass_further{},
-    crimson::ct_error::assert_all(fmt::format(
-      "{} -- addr={}, is_level_tail={}", FNAME, addr, expect_is_level_tail).c_str())
+    crimson::ct_error::all_same_way(
+      [FNAME, c, addr, expect_is_level_tail](const auto &e) {
+      ERRORT("{} -- addr={}, is_level_tail={}",
+        c.t, addr, expect_is_level_tail);
+      ceph_abort();
+      return eagain_iertr::make_ready_future<NodeExtentRef>();
+    })
   ).si_then([FNAME, c, addr, expect_is_level_tail](auto extent)
              -> eagain_ifuture<Ref<Node>> {
     assert(extent);
     auto header = extent->get_header();
     auto field_type = header.get_field_type();
-    if (!field_type) {
+    if (unlikely(!field_type)) {
       ERRORT("load addr={}, is_level_tail={} error, "
              "got invalid header -- {}",
              c.t, addr, expect_is_level_tail, fmt::ptr(extent));
       ceph_abort_msg("fatal error");
     }
-    if (header.get_is_level_tail() != expect_is_level_tail) {
+    if (unlikely(header.get_is_level_tail() != expect_is_level_tail)) {
       ERRORT("load addr={}, is_level_tail={} error, "
              "is_level_tail mismatch -- {}",
              c.t, addr, expect_is_level_tail, fmt::ptr(extent));
@@ -712,7 +717,7 @@ eagain_ifuture<Ref<Node>> Node::load(
 
     auto node_type = header.get_node_type();
     if (node_type == node_type_t::LEAF) {
-      if (extent->get_length() != c.vb.get_leaf_node_size()) {
+      if (unlikely(extent->get_length() != c.vb.get_leaf_node_size())) {
         ERRORT("load addr={}, is_level_tail={} error, "
                "leaf length mismatch -- {}",
                c.t, addr, expect_is_level_tail, fmt::ptr(extent));
@@ -723,7 +728,7 @@ eagain_ifuture<Ref<Node>> Node::load(
       return eagain_iertr::make_ready_future<Ref<Node>>(
        new LeafNode(derived_ptr, std::move(impl)));
     } else if (node_type == node_type_t::INTERNAL) {
-      if (extent->get_length() != c.vb.get_internal_node_size()) {
+      if (unlikely(extent->get_length() != c.vb.get_internal_node_size())) {
         ERRORT("load addr={}, is_level_tail={} error, "
                "internal length mismatch -- {}",
                c.t, addr, expect_is_level_tail, fmt::ptr(extent));
index 8190cc40e2b548bff9e961b8d300e31e03325628..ac638f435b9f0e9213cbd857a3d03e2ad4ea4132 100644 (file)
@@ -906,7 +906,9 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl {
 
  private:
   NodeLayoutT(NodeExtentRef extent) : extent{extent} {
+#ifndef NDEBUG
     build_name();
+#endif
   }
 
   extent_len_t filled_size() const {