]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: do not balance bluefs on every kv_sync_thread iteration 14557/head
authorSage Weil <sage@redhat.com>
Fri, 14 Apr 2017 16:15:02 +0000 (12:15 -0400)
committerSage Weil <sage@redhat.com>
Fri, 14 Apr 2017 16:15:02 +0000 (12:15 -0400)
This showed up with multiple samples in a wall-clock profile.  We do not
need to reconsider the freespace balance on every single kv commit cycle.

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..ee28638787fcad1fe0b1cf9f69222f6c52900589 100644 (file)
@@ -1020,6 +1020,7 @@ OPTION(bluestore_bluefs_min_ratio, OPT_FLOAT, .02)  // min fs free / total free
 OPTION(bluestore_bluefs_max_ratio, OPT_FLOAT, .90)  // max fs free / total free
 OPTION(bluestore_bluefs_gift_ratio, OPT_FLOAT, .02) // how much to add at a time
 OPTION(bluestore_bluefs_reclaim_ratio, OPT_FLOAT, .20) // how much to reclaim at a time
+OPTION(bluestore_bluefs_balance_interval, OPT_FLOAT, 1) // how often (sec) to balance free space between bluefs and bluestore
 // If you want to use spdk driver, you need to specify NVMe serial number here
 // with "spdk:" prefix.
 // Users can use 'lspci -vvv -d 8086:0953 | grep "Device Serial Number"' to
index e9f0d1d40f8042864d1a153af9e9c812f77fe769..663a1e83dd23fa5a3e8f7149909b721e5a2bafdb 100644 (file)
@@ -7847,7 +7847,10 @@ void BlueStore::_kv_sync_thread()
       }
 
       PExtentVector bluefs_gift_extents;
-      if (bluefs) {
+      if (bluefs &&
+         after_flush - bluefs_last_balance >
+         cct->_conf->bluestore_bluefs_balance_interval) {
+       bluefs_last_balance = after_flush;
        int r = _balance_bluefs_freespace(&bluefs_gift_extents);
        assert(r >= 0);
        if (r > 0) {
index 64200e398bdc1ba1d0acd4d031f1052ac6c703c7..8e6e224070394cee54fef0bb261b77a33f297f2f 100644 (file)
@@ -1723,6 +1723,8 @@ private:
   BlueFS *bluefs = nullptr;
   unsigned bluefs_shared_bdev = 0;  ///< which bluefs bdev we are sharing
   bool bluefs_single_shared_device = true;
+  utime_t bluefs_last_balance;
+
   KeyValueDB *db = nullptr;
   BlockDevice *bdev = nullptr;
   std::string freelist_type;