]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: tune deferred_batch_ops separately for hdd and ssd 14435/head
authorSage Weil <sage@redhat.com>
Mon, 10 Apr 2017 14:26:40 +0000 (10:26 -0400)
committerSage Weil <sage@redhat.com>
Thu, 13 Apr 2017 18:09:14 +0000 (14:09 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h

index 8984c35594e328804ded47bb4227a4200bbfa73e..4a74361547e38f141293c4c1bcee52a7793b2d20 100644 (file)
@@ -1111,7 +1111,9 @@ OPTION(bluestore_throttle_cost_per_io_ssd, OPT_U64, 4000)
 OPTION(bluestore_throttle_cost_per_io, OPT_U64, 0)
 OPTION(bluestore_deferred_max_ops, OPT_U64, 512)
 OPTION(bluestore_deferred_max_bytes, OPT_U64, 128*1024*1024)
-OPTION(bluestore_deferred_batch_ops, OPT_U64, 32)
+OPTION(bluestore_deferred_batch_ops, OPT_U64, 0)
+OPTION(bluestore_deferred_batch_ops_hdd, OPT_U64, 64)
+OPTION(bluestore_deferred_batch_ops_ssd, OPT_U64, 16)
 OPTION(bluestore_nid_prealloc, OPT_INT, 1024)
 OPTION(bluestore_blobid_prealloc, OPT_U64, 10240)
 OPTION(bluestore_clone_cow, OPT_BOOL, true)  // do copy-on-write for clones
index e9f0d1d40f8042864d1a153af9e9c812f77fe769..92afe79c9c0874afd12d29623246408fc9865845 100644 (file)
@@ -3252,6 +3252,9 @@ const char **BlueStore::get_tracked_conf_keys() const
     "bluestore_compression_max_blob_size",
     "bluestore_max_alloc_size",
     "bluestore_prefer_deferred_size",
+    "bleustore_deferred_batch_ops",
+    "bleustore_deferred_batch_ops_hdd",
+    "bleustore_deferred_batch_ops_ssd",
     "bluestore_max_ops",
     "bluestore_max_bytes",
     "bluestore_deferred_max_ops",
@@ -3274,7 +3277,10 @@ void BlueStore::handle_conf_change(const struct md_config_t *conf,
     _set_compression();
   }
   if (changed.count("bluestore_prefer_deferred_size") ||
-      changed.count("bluestore_max_alloc_size")) {
+      changed.count("bluestore_max_alloc_size") ||
+      changed.count("bluestore_deferred_batch_ops") ||
+      changed.count("bluestore_deferred_batch_ops_hdd") ||
+      changed.count("bluestore_deferred_batch_ops_ssd")) {
     if (bdev) {
       // only after startup
       _set_alloc_sizes();
@@ -3659,10 +3665,24 @@ void BlueStore::_set_alloc_sizes(void)
     }
   }
 
+  if (cct->_conf->bluestore_deferred_batch_ops) {
+    deferred_batch_ops = cct->_conf->bluestore_deferred_batch_ops;
+  } else {
+    assert(bdev);
+    if (bdev->is_rotational()) {
+      deferred_batch_ops = cct->_conf->bluestore_deferred_batch_ops_hdd;
+    } else {
+      deferred_batch_ops = cct->_conf->bluestore_deferred_batch_ops_ssd;
+    }
+  }
+
   dout(10) << __func__ << " min_alloc_size 0x" << std::hex << min_alloc_size
           << std::dec << " order " << min_alloc_size_order
           << " max_alloc_size 0x" << std::hex << max_alloc_size
-          << std::dec << dendl;
+          << " prefer_deferred_size 0x" << prefer_deferred_size
+          << std::dec
+          << " deferred_batch_ops " << deferred_batch_ops
+          << dendl;
 }
 
 int BlueStore::_open_bdev(bool create)
@@ -7919,7 +7939,7 @@ void BlueStore::_kv_sync_thread()
 
       if (!deferred_aggressive) {
        std::lock_guard<std::mutex> l(deferred_lock);
-       if (deferred_queue_size >= (int)g_conf->bluestore_deferred_batch_ops ||
+       if (deferred_queue_size >= deferred_batch_ops ||
            throttle_deferred_bytes.past_midpoint()) {
          _deferred_try_submit();
        }
index 64200e398bdc1ba1d0acd4d031f1052ac6c703c7..822d389b131bd691ebf5e7f6a5b9c0202f924722 100644 (file)
@@ -1789,6 +1789,7 @@ private:
   uint64_t min_alloc_size = 0; ///< minimum allocation unit (power of 2)
   size_t min_alloc_size_order = 0; ///< bits for min_alloc_size
   uint64_t prefer_deferred_size = 0; ///< size threshold for forced deferred writes
+  int deferred_batch_ops = 0; ///< deferred batch size
 
   uint64_t max_alloc_size = 0; ///< maximum allocation unit (power of 2)