From: Ronen Friedman Date: Thu, 11 Feb 2021 11:35:45 +0000 (+0200) Subject: os/bluestore: reduce number of wasted checks for low-priority logs X-Git-Tag: v17.1.0~2940^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6dd1c9933b8224718f07ea02db76191b6d0bd18e;p=ceph.git os/bluestore: reduce number of wasted checks for low-priority logs Signed-off-by: Ronen Friedman --- diff --git a/src/os/bluestore/BitmapAllocator.cc b/src/os/bluestore/BitmapAllocator.cc index a744eb17bfea..75f909c071e6 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;