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:
1 parent
cd94d35388
commit
940d32f69b
2 files changed
+8
No files matched your search
@@ -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")]
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in new issue
Block a user