Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm For PMAP_CACHE_VIVT platforms, make UBC_RELEASE_UNMA...



details:   https://anonhg.NetBSD.org/src/rev/75a41ef1c647
branches:  trunk
changeset: 544070:75a41ef1c647
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Mar 10 15:07:17 2003 +0000

description:
For PMAP_CACHE_VIVT platforms, make UBC_RELEASE_UNMAP evaluate to TRUE,
and add a comment explaining why.

Reviewed by Chuq Silvers.

diffstat:

 sys/uvm/uvm_bio.c |  26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diffs (67 lines):

diff -r c024f8fb737c -r 75a41ef1c647 sys/uvm/uvm_bio.c
--- a/sys/uvm/uvm_bio.c Mon Mar 10 13:18:07 2003 +0000
+++ b/sys/uvm/uvm_bio.c Mon Mar 10 15:07:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_bio.c,v 1.26 2002/09/27 15:38:08 provos Exp $      */
+/*     $NetBSD: uvm_bio.c,v 1.27 2003/03/10 15:07:17 thorpej Exp $     */
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.26 2002/09/27 15:38:08 provos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.27 2003/03/10 15:07:17 thorpej Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -117,14 +117,18 @@
 int ubc_nwins = UBC_NWINS;
 int ubc_winshift = UBC_WINSHIFT;
 int ubc_winsize;
-#ifdef PMAP_PREFER
+#if defined(PMAP_PREFER)
 int ubc_nqueues;
 boolean_t ubc_release_unmap = FALSE;
 #define UBC_NQUEUES ubc_nqueues
-#define UBC_RELEASE_UNMAP ubc_release_unmap
+#define UBC_RELEASE_UNMAP(uobj) \
+       (ubc_release_unmap && (((struct vnode *)uobj)->v_flag & VTEXT))
+#elif defined(PMAP_CACHE_VIVT)
+#define UBC_NQUEUES 1
+#define UBC_RELEASE_UNMAP(uobj) TRUE
 #else
 #define UBC_NQUEUES 1
-#define UBC_RELEASE_UNMAP FALSE
+#define UBC_RELEASE_UNMAP(uobj) FALSE
 #endif
 
 /*
@@ -529,18 +533,22 @@
        umap->writelen = 0;
        umap->refcount--;
        if (umap->refcount == 0) {
-               if (UBC_RELEASE_UNMAP &&
-                   (((struct vnode *)uobj)->v_flag & VTEXT)) {
+               if (UBC_RELEASE_UNMAP(uobj)) {
 
                        /*
+                        * if the cache is virtually indexed and virtually
+                        * tagged, we cannot create a compatible cache alias.
+                        *
                         * if this file is the executable image of
                         * some process, that process will likely have
                         * the file mapped at an alignment other than
                         * what PMAP_PREFER() would like.  we'd like
                         * to have process text be able to use the
                         * cache even if someone is also reading the
-                        * file, so invalidate mappings of such files
-                        * as soon as possible.
+                        * file.
+                        *
+                        * so invalidate mappings of such files as soon as
+                        * possible.
                         */
 
                        pmap_remove(pmap_kernel(), umapva,



Home | Main Index | Thread Index | Old Index