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
}
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) {
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;