Module Name: src
Committed By: ad
Date: Fri Apr 24 19:47:03 UTC 2020
Modified Files:
src/sys/uvm: uvm_bio.c
Log Message:
ubc_alloc_direct(): for a write make sure pages are always marked dirty
because there's no managed mapping.
To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/uvm/uvm_bio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.111 src/sys/uvm/uvm_bio.c:1.112
--- src/sys/uvm/uvm_bio.c:1.111 Thu Apr 23 21:53:01 2020
+++ src/sys/uvm/uvm_bio.c Fri Apr 24 19:47:03 2020
@@ -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 @@ again:
/* 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 @@ ubc_direct_release(struct uvm_object *uo
/* 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);