From d2023cf3b4b02a49f71bbc37f32b001ff8e6eca9 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 19 Jun 2016 10:14:11 -0400 Subject: [PATCH] os/bluestore: default to 512MB cache, buffered reads Test with small cache to exercise trimming. Signed-off-by: Sage Weil --- src/common/config_opts.h | 4 ++-- src/os/bluestore/BlueStore.cc | 2 +- src/test/objectstore/store_test.cc | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 854d834e1f3..068d7d5f023 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -966,7 +966,7 @@ OPTION(bluestore_compression_min_blob_size, OPT_U32, 256*1024) OPTION(bluestore_compression_max_blob_size, OPT_U32, 4*1024*1024) 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, 256*1024*1024) +OPTION(bluestore_buffer_cache_size, OPT_U32, 512*1024*1024) OPTION(bluestore_cache_tails, OPT_BOOL, true) // cache tail blocks in Onode OPTION(bluestore_kvbackend, OPT_STR, "rocksdb") OPTION(bluestore_allocator, OPT_STR, "stupid") // or "bitmap" @@ -989,7 +989,7 @@ OPTION(bluestore_nid_prealloc, OPT_INT, 1024) OPTION(bluestore_overlay_max_length, OPT_INT, 65536) OPTION(bluestore_overlay_max, OPT_INT, 0) OPTION(bluestore_clone_cow, OPT_BOOL, false) // do copy-on-write for clones -OPTION(bluestore_default_buffered_read, OPT_BOOL, false) +OPTION(bluestore_default_buffered_read, OPT_BOOL, true) OPTION(bluestore_debug_misc, OPT_BOOL, false) OPTION(bluestore_debug_no_reuse_blocks, OPT_BOOL, false) OPTION(bluestore_debug_small_allocations, OPT_INT, 0) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index c255e0b852b..6558c61e192 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -538,7 +538,7 @@ void BlueStore::LRUCache::trim(uint64_t onode_max, uint64_t buffer_max) << " refs; stopping with " << num << " left to trim" << dendl; break; } - dout(30) << __func__ << " trim " << o->oid << dendl; + dout(30) << __func__ << " rm " << o->oid << dendl; if (p != onode_lru.begin()) { onode_lru.erase(p--); } else { diff --git a/src/test/objectstore/store_test.cc b/src/test/objectstore/store_test.cc index 33ea9ffc1a1..d1efd2f9bd9 100644 --- a/src/test/objectstore/store_test.cc +++ b/src/test/objectstore/store_test.cc @@ -4827,6 +4827,11 @@ int main(int argc, char **argv) { g_ceph_context->_conf->set_val("bluestore_debug_freelist", "true"); g_ceph_context->_conf->set_val("bluestore_clone_cow", "true"); g_ceph_context->_conf->set_val("bluestore_max_alloc_size", "196608"); + + // set small cache sizes so we see trimming during Synthetic tests + g_ceph_context->_conf->set_val("bluestore_buffer_cache_size", "2000000"); + g_ceph_context->_conf->set_val("bluestore_onode_cache_size", "500"); + g_ceph_context->_conf->set_val( "enable_experimental_unrecoverable_data_corrupting_features", "*"); g_ceph_context->_conf->apply_changes(NULL); -- 2.39.5