]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore/BlueFS: Don't flush unused device.
authorJianpeng Ma <jianpeng.ma@intel.com>
Mon, 27 Jul 2020 06:59:08 +0000 (14:59 +0800)
committerJianpeng Ma <jianpeng.ma@intel.com>
Mon, 27 Jul 2020 06:59:08 +0000 (14:59 +0800)
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
src/os/bluestore/BlueFS.cc

index 44d2655bcdc4f835f51e02ddcd967f25166e9125..3cb41903bb1a40dd21ce88b625a5a57df47deaf8 100644 (file)
@@ -3093,9 +3093,12 @@ void BlueFS::flush_bdev()
 {
   // NOTE: this is safe to call without a lock.
   dout(20) << __func__ << dendl;
-  for (auto p : bdev) {
-    if (p)
-      p->flush();
+  for (unsigned i = 0; i < MAX_BDEV; i++) {
+    // alloc space from BDEV_SLOW is unexpected.
+    // So most cases we don't alloc from BDEV_SLOW and so avoiding flush not-used device.
+    if (bdev[i] && ((i != BDEV_SLOW) || (block_all[i].size() - alloc[i]->get_free()))) {
+      bdev[i]->flush();
+    }
   }
 }