]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: update the capacity calculation for lba/backref internal/leaf... 59570/head
authorZhang Song <zhangsong02@qianxin.com>
Tue, 3 Sep 2024 07:26:59 +0000 (15:26 +0800)
committerZhang Song <zhangsong02@qianxin.com>
Tue, 3 Sep 2024 07:29:05 +0000 (15:29 +0800)
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
src/crimson/os/seastore/backref/backref_tree_node.h
src/crimson/os/seastore/lba_manager/btree/lba_btree_node.h

index f2886ded95897b5b0f4c43d6be31394abe18958c..aee6e2a67eac313980b8e4d5fe47c018c11207e1 100644 (file)
@@ -10,7 +10,32 @@ namespace crimson::os::seastore::backref {
 using backref_node_meta_t = fixed_kv_node_meta_t<paddr_t>;
 using backref_node_meta_le_t = fixed_kv_node_meta_le_t<paddr_le_t>;
 
+/**
+ * Layout (4KiB):
+ *   checksum   : ceph_le32[1]               4B
+ *   size       : ceph_le32[1]               4B
+ *   meta       : backref_node_meta_le_t[1]  20B
+ *   keys       : paddr_le_t[CAPACITY]       (254*8)B
+ *   values     : paddr_le_t[CAPACITY]       (254*8)B
+ *                                           = 4092B
+ *
+ * TODO: make the above capacity calculation part of FixedKVNodeLayout
+ * TODO: the above alignment probably isn't portable without further work
+ */
 constexpr size_t INTERNAL_NODE_CAPACITY = 254;
+
+/**
+ * Layout (4KiB):
+ *   checksum   : ceph_le32[1]                    4B
+ *   size       : ceph_le32[1]                    4B
+ *   meta       : backref_node_meta_le_t[1]       20B
+ *   keys       : paddr_le_t[CAPACITY]            (193*8)B
+ *   values     : backref_map_val_le_t[CAPACITY]  (193*13)B
+ *                                                = 4081B
+ *
+ * TODO: update FixedKVNodeLayout to handle the above calculation
+ * TODO: the above alignment probably isn't portable without further work
+ */
 constexpr size_t LEAF_NODE_CAPACITY = 193;
 
 using BackrefNode = FixedKVNode<paddr_t>;
index 1c923acc87b68d4ec01ea2b848cbeaae15e5c872..ad5d336815bd871a330ce65607ec178873c0893a 100644 (file)
@@ -64,13 +64,13 @@ using lba_node_meta_le_t = fixed_kv_node_meta_le_t<laddr_le_t>;
  * Abstracts operations on and layout of internal nodes for the
  * LBA Tree.
  *
- * Layout (4k):
- *   checksum   :                            4b
- *   size       : uint32_t[1]                4b
- *   meta       : lba_node_meta_le_t[3]      (1*24)b
- *   keys       : laddr_t[255]               (254*8)b
- *   values     : paddr_t[255]               (254*8)b
- *                                           = 4096
+ * Layout (4KiB):
+ *   checksum   : ceph_le32[1]               4B
+ *   size       : ceph_le32[1]               4B
+ *   meta       : lba_node_meta_le_t[1]      20B
+ *   keys       : laddr_le_t[CAPACITY]       (254*8)B
+ *   values     : paddr_le_t[CAPACITY]       (254*8)B
+ *                                           = 4092B
 
  * TODO: make the above capacity calculation part of FixedKVNodeLayout
  * TODO: the above alignment probably isn't portable without further work
@@ -105,13 +105,13 @@ using LBAInternalNodeRef = LBAInternalNode::Ref;
  * Abstracts operations on and layout of leaf nodes for the
  * LBA Tree.
  *
- * Layout (4k):
- *   checksum   :                            4b
- *   size       : uint32_t[1]                4b
- *   meta       : lba_node_meta_le_t[3]      (1*24)b
- *   keys       : laddr_t[170]               (140*8)b
- *   values     : lba_map_val_t[170]         (140*21)b
- *                                           = 4092
+ * Layout (4KiB):
+ *   checksum   : ceph_le32[1]                4B
+ *   size       : ceph_le32[1]                4B
+ *   meta       : lba_node_meta_le_t[1]       20B
+ *   keys       : laddr_le_t[CAPACITY]        (140*8)B
+ *   values     : lba_map_val_le_t[CAPACITY]  (140*21)B
+ *                                            = 4088B
  *
  * TODO: update FixedKVNodeLayout to handle the above calculation
  * TODO: the above alignment probably isn't portable without further work