Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm ubc_alloc_direct(): for a write make sure pages are ...
details: https://anonhg.NetBSD.org/src/rev/1dfa3e423bfa
branches: trunk
changeset: 1009496:1dfa3e423bfa
user: ad <ad%NetBSD.org@localhost>
date: Fri Apr 24 19:47:03 2020 +0000
description:
ubc_alloc_direct(): for a write make sure pages are always marked dirty
because there's no managed mapping.
diffstat:
sys/uvm/uvm_bio.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diffs (42 lines):
diff -r 384783959420 -r 1dfa3e423bfa sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Fri Apr 24 19:38:10 2020 +0000
+++ b/sys/uvm/uvm_bio.c Fri Apr 24 19:47:03 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_bio.c,v 1.111 2020/04/23 21:53:01 ad Exp $ */
+/* $NetBSD: uvm_bio.c,v 1.112 2020/04/24 19:47:03 ad Exp $ */
/*
* Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.111 2020/04/23 21:53:01 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.112 2020/04/24 19:47:03 ad Exp $");
#include "opt_uvmhist.h"
#include "opt_ubc.h"
@@ -888,6 +888,11 @@
/* Page must be writable by now */
KASSERT((pg->flags & PG_RDONLY) == 0 || (flags & UBC_WRITE) == 0);
+
+ /* No managed mapping - mark the page dirty. */
+ if ((flags & UBC_WRITE) != 0) {
+ uvm_pagemarkdirty(pg, UVM_PAGE_STATUS_DIRTY);
+ }
}
rw_exit(uobj->vmobjlock);
@@ -916,10 +921,10 @@
/* Page was changed, no longer fake and neither clean. */
if (flags & UBC_WRITE) {
- pg->flags &= ~PG_FAKE;
KASSERTMSG(uvm_pagegetdirty(pg) ==
UVM_PAGE_STATUS_DIRTY,
"page %p not dirty", pg);
+ pg->flags &= ~PG_FAKE;
}
}
rw_exit(uobj->vmobjlock);
Home |
Main Index |
Thread Index |
Old Index