"examples/vscode:/vscode.git/clone" did not exist on "2b04ec2ff7270d2044410378b04d85a194fa3d4a"
Unverified Commit e2574ee9 authored by Zhiqiang Xie's avatar Zhiqiang Xie Committed by GitHub
Browse files

fix hicache write back (#5543)

parent ab4b5606
...@@ -92,7 +92,7 @@ class HiRadixCache(RadixCache): ...@@ -92,7 +92,7 @@ class HiRadixCache(RadixCache):
self.ongoing_write_through[node.id] = node self.ongoing_write_through[node.id] = node
self.inc_lock_ref(node) self.inc_lock_ref(node)
else: else:
return None return 0
return len(host_indices) return len(host_indices)
...@@ -153,6 +153,7 @@ class HiRadixCache(RadixCache): ...@@ -153,6 +153,7 @@ class HiRadixCache(RadixCache):
if x.host_value is None: if x.host_value is None:
if self.cache_controller.write_policy == "write_back": if self.cache_controller.write_policy == "write_back":
num_evicted += self.write_backup(x) num_evicted += self.write_backup(x)
pending_nodes.append(x)
elif self.cache_controller.write_policy == "write_through_selective": elif self.cache_controller.write_policy == "write_through_selective":
num_evicted += self._evict_write_through_selective(x) num_evicted += self._evict_write_through_selective(x)
else: else:
...@@ -177,6 +178,9 @@ class HiRadixCache(RadixCache): ...@@ -177,6 +178,9 @@ class HiRadixCache(RadixCache):
while len(self.ongoing_write_through) > 0: while len(self.ongoing_write_through) > 0:
self.writing_check() self.writing_check()
time.sleep(0.1) time.sleep(0.1)
for node in pending_nodes:
assert node.host_value is not None
self._evict_write_through(node)
def _evict_write_through(self, node: TreeNode): def _evict_write_through(self, node: TreeNode):
# evict a node already written to host # evict a node already written to host
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment