MCPcopy Create free account
hub / github.com/apache/impala / EvictCleanPage

Method EvictCleanPage

be/src/runtime/bufferpool/buffer-allocator.cc:613–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613bool BufferPool::FreeBufferArena::EvictCleanPage(
614 int64_t buffer_len, BufferHandle* buffer) {
615 PerSizeLists* lists = GetListsForSize(buffer_len);
616 // Check before acquiring lock.
617 if (lists->num_clean_pages.Load() == 0) return false;
618
619 lock_guard<SpinLock> al(lock_);
620 DCHECK_EQ(lists->num_clean_pages.Load(), lists->clean_pages.size());
621 Page* page = lists->clean_pages.Dequeue();
622 if (page == nullptr) return false;
623 lists->num_clean_pages.Add(-1);
624 parent_->clean_page_bytes_remaining_.Add(buffer_len);
625 lock_guard<SpinLock> pl(page->buffer_lock);
626 *buffer = move(page->buffer);
627 return true;
628}
629
630pair<int64_t, int64_t> BufferPool::FreeBufferArena::FreeSystemMemory(
631 int64_t target_bytes_to_free, int64_t target_bytes_to_claim,

Callers 1

AllocateInternalMethod · 0.80

Calls 5

moveFunction · 0.85
LoadMethod · 0.45
sizeMethod · 0.45
DequeueMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected