]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: smooth space balancing a bit
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 7 Sep 2019 02:04:50 +0000 (10:04 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 10 Sep 2019 12:36:49 +0000 (20:36 +0800)
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 <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index d4358b47a4844889924a03d2ea083eae487a5c63..ede9e1653b2275c3ad8aaa1207fb8d9ca2522f8c 100644 (file)
@@ -5700,7 +5700,7 @@ int BlueStore::allocate_bluefs_freespace(
     int64_t alloc_len;
     do {
       // hard cap to fit into 32 bits
-      gift = std::min<uint64_t>(size, 1ull << 31);
+      gift = std::min<uint64_t>(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<uint64_t>(reclaim, 1ull << 31);
+    reclaim = std::min<uint64_t>(reclaim, 1ull << 30);
     dout(10) << __func__ << " reclaiming " << reclaim
             << " (" << byte_u_t(reclaim) << ")" << dendl;