From a24b3b25e71aa180859f34b28ad75ffd325608f3 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Fri, 10 Sep 2021 16:37:05 +0800 Subject: [PATCH] crimson/os/seastore: minimize the static size of onode_layout_t Signed-off-by: Yingxin Cheng --- src/crimson/os/seastore/onode.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/crimson/os/seastore/onode.h b/src/crimson/os/seastore/onode.h index 04de0caaeaa..a4be9ac9884 100644 --- a/src/crimson/os/seastore/onode.h +++ b/src/crimson/os/seastore/onode.h @@ -14,11 +14,8 @@ namespace crimson::os::seastore { struct onode_layout_t { - // around 350 bytes for fixed fields in object_info_t, - // the left are for the variable-sized fields like oid - // FIXME: object_info_t may need to shrinked, at least - // oid doesn't need to be held in it. - static constexpr int MAX_OI_LENGTH = 1024; + // The expected decode size of object_info_t without oid. + static constexpr int MAX_OI_LENGTH = 232; // We might want to move the ss field out of onode_layout_t. // The reason is that ss_attr may grow to relative large, as // its clone_overlap may grow to a large size, if applications @@ -26,7 +23,9 @@ struct onode_layout_t { // the number of objects per OSD, so that all objects' metadata // can be cached in memory) and do many modifications between // snapshots. - static constexpr int MAX_SS_LENGTH = 128; + // TODO: implement flexible-sized onode value to store inline ss_attr + // effectively. + static constexpr int MAX_SS_LENGTH = 1; ceph_le32 size{0}; ceph_le32 oi_size{0}; -- 2.39.5