]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: add config for allocator
authorRamesh Chander <Ramesh.Chander@sandisk.com>
Mon, 16 May 2016 21:30:05 +0000 (17:30 -0400)
committerSage Weil <sage@redhat.com>
Mon, 16 May 2016 21:31:50 +0000 (17:31 -0400)
Signed-off-by: Ramesh Chander <Ramesh.Chander@sandisk.com
src/common/config_opts.h
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueStore.cc

index c7dba32cd323de4ec47739566f975e1dff935f90..67d729ce3370620c0692bc7378b1ac00a6ffb336 100644 (file)
@@ -947,6 +947,7 @@ OPTION(bluestore_min_alloc_size, OPT_U32, 64*1024)
 OPTION(bluestore_onode_map_size, OPT_U32, 1024)   // onodes per collection
 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"
 OPTION(bluestore_freelist_type, OPT_STR, "bitmap")
 OPTION(bluestore_freelist_blocks_per_key, OPT_INT, 128)
 OPTION(bluestore_rocksdb_options, OPT_STR, "compression=kNoCompression,max_write_buffer_number=16,min_write_buffer_number_to_merge=3,recycle_log_file_num=16")
index 0e952776a9feca08e3832b0e30ebef6958fecc3a..c8d7f72e006c886e52925d8c33d1d2a68dfeb609 100644 (file)
@@ -280,7 +280,7 @@ void BlueFS::_init_alloc()
   for (unsigned id = 0; id < bdev.size(); ++id) {
     if (!bdev[id])
       continue;
-    alloc[id] = Allocator::create("stupid");
+    alloc[id] = Allocator::create(g_conf->bluestore_allocator);
     interval_set<uint64_t>& p = block_all[id];
     for (interval_set<uint64_t>::iterator q = p.begin(); q != p.end(); ++q) {
       alloc[id]->init_add_free(q.get_start(), q.get_len());
index 8d967735bb5e251c805dcda21c8d7a18bfe2e6dc..49c0500bae09146cc522e6e7154142451ca3da53 100644 (file)
@@ -1044,7 +1044,7 @@ void BlueStore::_close_fm()
 int BlueStore::_open_alloc()
 {
   assert(alloc == NULL);
-  alloc = Allocator::create("stupid");
+  alloc = Allocator::create(g_conf->bluestore_allocator);
   uint64_t num = 0, bytes = 0;
   fm->enumerate_reset();
   uint64_t offset, length;