From c953d27fe6e2b3bce15b7701444e5ec2ba0d28e5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Sep 2016 12:34:57 -0400 Subject: [PATCH] os/bluestore: tunable prealloc size for ExtentMap inline_bl Otherwise we eat 4KB for every Onode. Signed-off-by: Sage Weil --- src/common/config_opts.h | 1 + src/os/bluestore/BlueStore.cc | 6 ++++++ src/os/bluestore/BlueStore.h | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index e7976f436bec..584dad4f310f 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -979,6 +979,7 @@ OPTION(bluestore_compression_required_ratio, OPT_DOUBLE, .875) OPTION(bluestore_extent_map_shard_max_size, OPT_U32, 1200) OPTION(bluestore_extent_map_shard_target_size, OPT_U32, 500) OPTION(bluestore_extent_map_shard_min_size, OPT_U32, 150) +OPTION(bluestore_extent_map_inline_shard_prealloc_size, OPT_U32, 256) OPTION(bluestore_cache_type, OPT_STR, "2q") // lru, 2q OPTION(bluestore_onode_cache_size, OPT_U32, 16*1024) OPTION(bluestore_buffer_cache_size, OPT_U32, 512*1024*1024) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index f09b22faeaba..c05f8855bae9 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1428,6 +1428,12 @@ ostream& operator<<(ostream& out, const BlueStore::Extent& e) #undef dout_prefix #define dout_prefix *_dout << "bluestore.extentmap(" << this << ") " +BlueStore::ExtentMap::ExtentMap(Onode *o) + : onode(o), + inline_bl(g_conf->bluestore_extent_map_inline_shard_prealloc_size) { +} + + bool BlueStore::ExtentMap::update(Onode *o, KeyValueDB::Transaction t, bool force) { diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index eac753e766b9..61774e8149da 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -546,7 +546,7 @@ public: bool inline_dirty = false; bufferlist inline_bl; ///< cached encoded map, if unsharded; empty=>dirty - ExtentMap(Onode *o) : onode(o) {} + ExtentMap(Onode *o); bool encode_some(uint32_t offset, uint32_t length, bufferlist& bl, unsigned *pn); -- 2.47.3