From: xie xingguo Date: Sat, 7 Sep 2019 02:04:50 +0000 (+0800) Subject: os/bluestore: smooth space balancing a bit X-Git-Tag: v15.1.0~1608^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ad57dc0fde4d3356d66e789cac9e1bfcdc252769;p=ceph-ci.git os/bluestore: smooth space balancing a bit For workloads that need to handle tons of small objects, the space of "slow" could become extremely fragmented, which makes it is hard to transmit free space between bluestore and bluefs. Hard cap alloc size at 1GB at per request, so there is 1024 small allocations at most. Hence we don't block write ops for long. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d4358b47a48..ede9e1653b2 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -5700,7 +5700,7 @@ int BlueStore::allocate_bluefs_freespace( int64_t alloc_len; do { // hard cap to fit into 32 bits - gift = std::min(size, 1ull << 31); + gift = std::min(size, 1ull << 30); dout(10) << __func__ << " gifting " << gift << " (" << byte_u_t(gift) << ")" << dendl; @@ -5870,7 +5870,7 @@ int BlueStore::_balance_bluefs_freespace() auto reclaim = p2roundup(uint64_t(-delta), alloc_size); // hard cap to fit into 32 bits - reclaim = std::min(reclaim, 1ull << 31); + reclaim = std::min(reclaim, 1ull << 30); dout(10) << __func__ << " reclaiming " << reclaim << " (" << byte_u_t(reclaim) << ")" << dendl;