| 79 | } |
| 80 | |
| 81 | void MigrationController::Clear(Profiler& profiler) { |
| 82 | profiler.AddPageMoveInter(dirty_entries_); // epoch write-backs |
| 83 | for (PTTEntryIterator it = entries_.begin(); it != entries_.end(); ++it) { |
| 84 | it->second.epoch_reads = 0; |
| 85 | it->second.epoch_writes = 0; |
| 86 | if (it->second.state == PTTEntry::DIRTY_DIRECT) { |
| 87 | ShiftState(it->second, PTTEntry::CLEAN_DIRECT, Profiler::Overlap); |
| 88 | --dirty_entries_; |
| 89 | } else if (it->second.state == PTTEntry::DIRTY_STATIC) { |
| 90 | ShiftState(it->second, PTTEntry::CLEAN_STATIC, Profiler::Overlap); |
| 91 | --dirty_entries_; |
| 92 | } |
| 93 | } |
| 94 | profiler.AddTableOp(); |
| 95 | assert(dirty_entries_ == 0); |
| 96 | |
| 97 | nvm_pages_.clear(); |
| 98 | dram_heap_.clear(); |
| 99 | nvm_heap_.clear(); |
| 100 | } |