Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] Remove suspend section when spilling Velox task #6875

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions cpp/velox/compute/WholeStageResultIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,29 +209,6 @@ std::shared_ptr<ColumnarBatch> WholeStageResultIterator::next() {
return std::make_shared<VeloxColumnarBatch>(vector);
}

namespace {
class SuspendedSection {
public:
SuspendedSection() {
reclaimer_->enterArbitration();
}

virtual ~SuspendedSection() {
reclaimer_->leaveArbitration();
}

// singleton
SuspendedSection(const SuspendedSection&) = delete;
SuspendedSection(SuspendedSection&&) = delete;
SuspendedSection& operator=(const SuspendedSection&) = delete;
SuspendedSection& operator=(SuspendedSection&&) = delete;

private:
// We only use suspension APIs in exec::MemoryReclaimer.
std::unique_ptr<velox::memory::MemoryReclaimer> reclaimer_{velox::exec::MemoryReclaimer::create()};
};
} // namespace

int64_t WholeStageResultIterator::spillFixedSize(int64_t size) {
auto pool = memoryManager_->getAggregateMemoryPool();
std::string poolName{pool->root()->name() + "/" + pool->name()};
Expand All @@ -241,9 +218,6 @@ int64_t WholeStageResultIterator::spillFixedSize(int64_t size) {
if (spillStrategy_ == "auto") {
int64_t remaining = size - shrunken;
LOG(INFO) << logPrefix << "Trying to request spilling for " << remaining << " bytes...";
// suspend the driver when we are on it
SuspendedSection suspender;
velox::exec::MemoryReclaimer::Stats status;
auto* mm = memoryManager_->getMemoryManager();
uint64_t spilledOut = mm->arbitrator()->shrinkCapacity(remaining); // this conducts spilling
LOG(INFO) << logPrefix << "Successfully spilled out " << spilledOut << " bytes.";
Expand Down
Loading