From: Jianpeng Ma Date: Mon, 27 Jul 2020 06:59:08 +0000 (+0800) Subject: os/bluestore/BlueFS: Don't flush unused device. X-Git-Tag: wip-pdonnell-testing-20200918.022351~530^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6600814b55ebc0994575891f688a2ff2a6ccbf4f;p=ceph-ci.git os/bluestore/BlueFS: Don't flush unused device. Signed-off-by: Jianpeng Ma --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 44d2655bcdc..3cb41903bb1 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -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(); + } } }