Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/yamt-pagecache]: src/sys/uvm uvm_loanobj_read: try to avoid creating VAC...
details: https://anonhg.NetBSD.org/src/rev/796975cece29
branches: yamt-pagecache
changeset: 770852:796975cece29
user: yamt <yamt%NetBSD.org@localhost>
date: Wed Dec 28 13:24:19 2011 +0000
description:
uvm_loanobj_read: try to avoid creating VAC aliases if PMAP_PREFER is available
diffstat:
sys/uvm/uvm_loan.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diffs (42 lines):
diff -r 54d895e4d65e -r 796975cece29 sys/uvm/uvm_loan.c
--- a/sys/uvm/uvm_loan.c Wed Dec 28 13:22:47 2011 +0000
+++ b/sys/uvm/uvm_loan.c Wed Dec 28 13:24:19 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_loan.c,v 1.81.2.7 2011/12/28 13:21:27 yamt Exp $ */
+/* $NetBSD: uvm_loan.c,v 1.81.2.8 2011/12/28 13:24:19 yamt Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.7 2011/12/28 13:21:27 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.81.2.8 2011/12/28 13:24:19 yamt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1394,6 +1394,23 @@
if (npages > MAXPAGES) {
return EINVAL;
}
+#if defined(PMAP_PREFER)
+ /*
+ * avoid creating VAC aliases.
+ */
+ {
+ const vaddr_t origva = va;
+
+ PMAP_PREFER(off, &va, len, 0);
+ if (va != origva) {
+ /*
+ * pmap's suggestion was different from the requested
+ * address. punt.
+ */
+ return EINVAL;
+ }
+ }
+#endif /* defined(PMAP_PREFER) */
retry:
vm_map_lock_read(map);
if (!uvm_map_lookup_entry(map, va, &entry)) {
Home |
Main Index |
Thread Index |
Old Index