From ad57dc0fde4d3356d66e789cac9e1bfcdc252769 Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Sat, 7 Sep 2019 10:04:50 +0800 Subject: [PATCH] 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 --- src/os/bluestore/BlueStore.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d4358b47a4844..ede9e1653b227 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; -- 2.39.5