From: Zhang Song Date: Tue, 3 Sep 2024 07:26:59 +0000 (+0800) Subject: crimson/os/seastore: update the capacity calculation for lba/backref internal/leaf... X-Git-Tag: v20.0.0~1129^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1e97d4f64473d4b000022e464ed83c84709d70c4;p=ceph.git crimson/os/seastore: update the capacity calculation for lba/backref internal/leaf nodes Signed-off-by: Zhang Song --- diff --git a/src/crimson/os/seastore/backref/backref_tree_node.h b/src/crimson/os/seastore/backref/backref_tree_node.h index f2886ded95897..aee6e2a67eac3 100644 --- a/src/crimson/os/seastore/backref/backref_tree_node.h +++ b/src/crimson/os/seastore/backref/backref_tree_node.h @@ -10,7 +10,32 @@ namespace crimson::os::seastore::backref { using backref_node_meta_t = fixed_kv_node_meta_t; using backref_node_meta_le_t = fixed_kv_node_meta_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; diff --git a/src/crimson/os/seastore/lba_manager/btree/lba_btree_node.h b/src/crimson/os/seastore/lba_manager/btree/lba_btree_node.h index 1c923acc87b68..ad5d336815bd8 100644 --- a/src/crimson/os/seastore/lba_manager/btree/lba_btree_node.h +++ b/src/crimson/os/seastore/lba_manager/btree/lba_btree_node.h @@ -64,13 +64,13 @@ using lba_node_meta_le_t = fixed_kv_node_meta_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