GPU: a marked page's copy-back does not save the page for its own copy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MarvisandClaude Opus 5.5 committed 2026-11-25 02:36:53 +01:00
1 parent cd94d35388
commit 940d32f69b
2 files changed
+8

No files matched your search

+2
View File
@@ -436,6 +436,8 @@ impl Shadow {
if from >= to {
return 0;
}
// Our own write below must not save the page for this copy again.
t.unarm(page / PAGE);
let saved = t.saved(page / PAGE);
if saved.is_none() && t.changed(page / PAGE) {
#[cfg(feature = "diagnostics")]
+6
View File
@@ -373,6 +373,12 @@ impl Tracked {
}
}
/// Page `page` (a page number) needs no saving any more: its copy-back
/// is under way.
pub(crate) fn unarm(&self, page: usize) {
self.changed.1.lock().unwrap_or_else(|e| e.into_inner()).armed.remove(&page);
}
/// No shader writes the copy any more: nothing is armed or kept.
pub(crate) fn disarm(&self) {
let mut saved = self.changed.1.lock().unwrap_or_else(|e| e.into_inner());