Archived
sched: gate preempted prefill on whole recompute plus running headroom
This commit is contained in:
1 parent
4a61d7296b
commit
e668d493d9
7 files changed
+156
-2
No files matched your search
@@ -262,6 +262,24 @@ struct FakeKV : IKVManager {
|
||||
if (geom.g[i].paged && rows_for((int)i, n) > total[i]) return false;
|
||||
return true;
|
||||
}
|
||||
bool can_grow(uint64_t id, int64_t n) const override {
|
||||
auto it = seqs.find(id);
|
||||
if (it == seqs.end()) return false;
|
||||
const Seq& q = it->second;
|
||||
if (n <= q.n) return true;
|
||||
for (size_t i = 0; i < gs.size(); ++i) {
|
||||
if (geom.g[i].paged) {
|
||||
int64_t need = rows_for((int)i, n) - (int64_t)q.blocks[i].size();
|
||||
if (need > 0 && need > (int64_t)freelist[i].size()) return false;
|
||||
} else if (!geom.g[i].paged && q.state[i] < 0 && state_free[i].empty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
int64_t available_blocks(int32_t g) const override {
|
||||
return g >= 0 && g < (int32_t)freelist.size() ? (int64_t)freelist[(size_t)g].size() : 0;
|
||||
}
|
||||
|
||||
const std::vector<int32_t>& block_table(uint64_t id, int32_t g) const override {
|
||||
auto it = seqs.find(id);
|
||||
|
||||
Reference in new issue
Block a user