Merge pull request #14348 from rzarzynski/wip-bs-bitmap-no-virts-in-hotspot

os/bluestore: avoid the VTABLE-related burden in BitMapAllocator's hotspot

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-04-07 09:39:18 -05:00 committed by GitHub
commit c43faf1dd2
2 changed files with 5 additions and 5 deletions

View File

@ -323,7 +323,7 @@ BitMapZone::~BitMapZone()
inline bool BitMapZone::is_exhausted()
{
/* BitMapZone::get_used_blocks operates atomically. No need for lock. */
return get_used_blocks() == size();
return BitMapZone::get_used_blocks() == BitMapZone::size();
}
bool BitMapZone::is_allocated(int64_t start_block, int64_t num_blocks)
@ -989,7 +989,7 @@ inline bool BitMapAreaLeaf::child_check_n_lock(BitMapZone* const child,
/* The exhausted check can be performed without acquiring the lock. This
* is because 1) BitMapZone::is_exhausted() actually operates atomically
* and 2) it's followed by the exclusive, required-aware re-verification. */
if (child->is_exhausted()) {
if (child->BitMapZone::is_exhausted()) {
return false;
}

View File

@ -348,7 +348,7 @@ public:
static void incr_count() { count++;}
static int64_t get_total_blocks() {return total_blocks;}
bool is_allocated(int64_t start_block, int64_t num_blocks) override;
bool is_exhausted() override;
bool is_exhausted() override final;
void reset_marker();
int64_t sub_used_blocks(int64_t num_blocks) override;
@ -356,8 +356,8 @@ public:
bool reserve_blocks(int64_t num_blocks) override;
void unreserve(int64_t num_blocks, int64_t allocated) override;
int64_t get_reserved_blocks() override;
int64_t get_used_blocks() override;
int64_t size() override {
int64_t get_used_blocks() override final;
int64_t size() override final {
return get_total_blocks();
}