From 6dd1c9933b8224718f07ea02db76191b6d0bd18e Mon Sep 17 00:00:00 2001 From: Ronen Friedman Date: Thu, 11 Feb 2021 13:35:45 +0200 Subject: [PATCH] os/bluestore: reduce number of wasted checks for low-priority logs Signed-off-by: Ronen Friedman --- src/os/bluestore/BitmapAllocator.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/os/bluestore/BitmapAllocator.cc b/src/os/bluestore/BitmapAllocator.cc index a744eb17bfe..75f909c071e 100644 --- a/src/os/bluestore/BitmapAllocator.cc +++ b/src/os/bluestore/BitmapAllocator.cc @@ -36,12 +36,14 @@ int64_t BitmapAllocator::allocate( if (!allocated) { return -ENOSPC; } - for (auto i = old_size; i < extents->size(); ++i) { - auto& e = (*extents)[i]; - ldout(cct, 10) << __func__ - << " extent: 0x" << std::hex << e.offset << "~" << e.length - << "/" << alloc_unit << "," << max_alloc_size << "," << hint - << std::dec << dendl; + if (cct->_conf->subsys.should_gather()) { + for (auto i = old_size; i < extents->size(); ++i) { + auto& e = (*extents)[i]; + ldout(cct, 10) << __func__ + << " extent: 0x" << std::hex << e.offset << "~" << e.length + << "/" << alloc_unit << "," << max_alloc_size << "," << hint + << std::dec << dendl; + } } return int64_t(allocated); } @@ -49,9 +51,11 @@ int64_t BitmapAllocator::allocate( void BitmapAllocator::release( const interval_set& release_set) { - for (auto r : release_set) { - ldout(cct, 10) << __func__ << " 0x" << std::hex << r.first << "~" << r.second - << std::dec << dendl; + if (cct->_conf->subsys.should_gather()) { + for (auto r : release_set) { + ldout(cct, 10) << __func__ << " 0x" << std::hex << r.first << "~" << r.second + << std::dec << dendl; + } } _free_l2(release_set); ldout(cct, 10) << __func__ << " done" << dendl; -- 2.47.3