From c154718c8aeefb109e6db6dc9633a4748064648b Mon Sep 17 00:00:00 2001 From: Raimund Sacherer Date: Fri, 26 May 2023 17:15:43 +0200 Subject: [PATCH] osd: make _set_cache_sizes ratio aware of cache_kv_onode_ratio The formula checking if all the cache sizes sum up to <= 1 did not take cache_kv_onode_ratio into account. The last dout line did also not take cache_kv_onode_ratio into account. Signed-off-by: Raimund Sacherer (cherry picked from commit 8d32e586dcbf355ea7155a4a8c06389be07a2fe8) --- src/os/bluestore/BlueStore.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index aa14d0204f7aa..d463453cd4119 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -4955,10 +4955,11 @@ int BlueStore::_set_cache_sizes() return -EINVAL; } - if (cache_meta_ratio + cache_kv_ratio > 1.0) { + if (cache_meta_ratio + cache_kv_ratio + cache_kv_onode_ratio > 1.0) { derr << __func__ << " bluestore_cache_meta_ratio (" << cache_meta_ratio << ") + bluestore_cache_kv_ratio (" << cache_kv_ratio - << ") = " << cache_meta_ratio + cache_kv_ratio << "; must be <= 1.0" + << ") + bluestore_cache_kv_onode_ratio (" << cache_kv_onode_ratio + << ") = " << cache_meta_ratio + cache_kv_ratio + cache_kv_onode_ratio << "; must be <= 1.0" << dendl; return -EINVAL; } @@ -4975,6 +4976,7 @@ int BlueStore::_set_cache_sizes() dout(1) << __func__ << " cache_size " << cache_size << " meta " << cache_meta_ratio << " kv " << cache_kv_ratio + << " kv_onode " << cache_kv_onode_ratio << " data " << cache_data_ratio << dendl; return 0; -- 2.39.5