Source-Changes-HG archive

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

[src/chs-ubc2]: src/sys after setting VTEXT on a vnode, flush any UBC mappings



details:   https://anonhg.NetBSD.org/src/rev/73aee175f6fc
branches:  chs-ubc2
changeset: 471357:73aee175f6fc
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Jul 04 01:33:33 1999 +0000

description:
after setting VTEXT on a vnode, flush any UBC mappings
to try to prevent unnecessary VAC aliases.

diffstat:

 sys/arch/mips/mips/cpu_exec.c             |  10 +++++++++-
 sys/arch/mips/mips/elf.c                  |  11 ++++++++++-
 sys/arch/pica/pica/elf.c                  |  10 +++++++++-
 sys/compat/common/compat_exec.c           |  10 +++++++++-
 sys/compat/hpux/hpux_exec.c               |  10 +++++++++-
 sys/compat/ibcs2/ibcs2_exec.c             |  10 +++++++++-
 sys/compat/linux/common/linux_exec_aout.c |  10 +++++++++-
 sys/compat/m68k4k/m68k4k_exec.c           |  10 +++++++++-
 sys/compat/netbsd32/netbsd32_exec.c       |  10 +++++++++-
 sys/compat/sunos/sunos_exec.c             |  10 +++++++++-
 sys/kern/exec_aout.c                      |  10 +++++++++-
 sys/kern/exec_ecoff.c                     |  10 +++++++++-
 sys/kern/exec_elf32.c                     |  11 ++++++++++-
 13 files changed, 119 insertions(+), 13 deletions(-)

diffs (truncated from 327 to 300 lines):

diff -r 9888ecc35f54 -r 73aee175f6fc sys/arch/mips/mips/cpu_exec.c
--- a/sys/arch/mips/mips/cpu_exec.c     Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/arch/mips/mips/cpu_exec.c     Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_exec.c,v 1.19.4.1 1999/06/21 00:52:05 thorpej Exp $        */
+/*     $NetBSD: cpu_exec.c,v 1.19.4.2 1999/07/04 01:33:33 chs Exp $    */
 
 /*
  * Copyright (c) 1992, 1993
@@ -114,7 +114,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, hdr -> a_text,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/arch/mips/mips/elf.c
--- a/sys/arch/mips/mips/elf.c  Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/arch/mips/mips/elf.c  Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elf.c,v 1.12.10.1 1999/06/21 00:52:06 thorpej Exp $    */
+/*     $NetBSD: elf.c,v 1.12.10.2 1999/07/04 01:33:33 chs Exp $        */
 /* from: NetBSD: exec_elf.c,v 1.3 1995/09/16 00:28:08 thorpej Exp      */
 
 /*       mips elf shared-library support from Per Fogelstrom's OpenBSD code */
@@ -689,7 +689,16 @@
 
 #ifdef EXEC_AOUT
        free((char *) ph, M_TEMP);
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
+
        return exec_aout_setup_stack(p, epp);
 #endif
 
diff -r 9888ecc35f54 -r 73aee175f6fc sys/arch/pica/pica/elf.c
--- a/sys/arch/pica/pica/elf.c  Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/arch/pica/pica/elf.c  Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elf.c,v 1.3 1996/10/13 03:31:41 christos Exp $ */
+/*     $NetBSD: elf.c,v 1.3.24.1 1999/07/04 01:33:33 chs Exp $ */
 
 /*
  * Copyright (c) 1994 Ted Lemon
@@ -97,7 +97,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        epp->ep_taddr = 0;
        epp->ep_tsize = 0;
diff -r 9888ecc35f54 -r 73aee175f6fc sys/compat/common/compat_exec.c
--- a/sys/compat/common/compat_exec.c   Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/compat/common/compat_exec.c   Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_exec.c,v 1.1 1996/05/18 15:52:21 christos Exp $ */
+/*     $NetBSD: compat_exec.c,v 1.1.26.1 1999/07/04 01:33:34 chs Exp $ */
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -74,7 +74,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/compat/hpux/hpux_exec.c
--- a/sys/compat/hpux/hpux_exec.c       Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/compat/hpux/hpux_exec.c       Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpux_exec.c,v 1.13 1999/02/09 20:21:18 christos Exp $  */
+/*     $NetBSD: hpux_exec.c,v 1.13.4.1 1999/07/04 01:33:34 chs Exp $   */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -222,7 +222,15 @@
        if ((execp->ha_text != 0 || execp->ha_data != 0) &&
            epp->ep_vp->v_writecount != 0)
                return (ETXTBSY);
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /*
         * HP-UX ZMAGIC executables need to have their segment
diff -r 9888ecc35f54 -r 73aee175f6fc sys/compat/ibcs2/ibcs2_exec.c
--- a/sys/compat/ibcs2/ibcs2_exec.c     Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/compat/ibcs2/ibcs2_exec.c     Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_exec.c,v 1.22.4.1 1999/06/21 01:07:12 thorpej Exp $      */
+/*     $NetBSD: ibcs2_exec.c,v 1.22.4.2 1999/07/04 01:33:34 chs Exp $  */
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -496,7 +496,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 #endif
        
        /* DPRINTF(("VMCMD: addr %x size %d offset %d\n", epp->ep_taddr,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/compat/linux/common/linux_exec_aout.c
--- a/sys/compat/linux/common/linux_exec_aout.c Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/compat/linux/common/linux_exec_aout.c Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_exec_aout.c,v 1.37 1999/02/09 20:37:19 christos Exp $    */
+/*     $NetBSD: linux_exec_aout.c,v 1.37.4.1 1999/07/04 01:33:34 chs Exp $     */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -335,7 +335,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/compat/m68k4k/m68k4k_exec.c
--- a/sys/compat/m68k4k/m68k4k_exec.c   Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/compat/m68k4k/m68k4k_exec.c   Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: m68k4k_exec.c,v 1.3 1999/02/20 23:25:55 thorpej Exp $  */
+/*     $NetBSD: m68k4k_exec.c,v 1.3.4.1 1999/07/04 01:33:35 chs Exp $  */
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -162,7 +162,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/compat/netbsd32/netbsd32_exec.c
--- a/sys/compat/netbsd32/netbsd32_exec.c       Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/compat/netbsd32/netbsd32_exec.c       Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_exec.c,v 1.15 1999/03/26 04:29:26 eeh Exp $   */
+/*     $NetBSD: netbsd32_exec.c,v 1.15.4.1 1999/07/04 01:33:35 chs Exp $       */
 /*     from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */
 
 /*
@@ -185,7 +185,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/compat/sunos/sunos_exec.c
--- a/sys/compat/sunos/sunos_exec.c     Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/compat/sunos/sunos_exec.c     Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sunos_exec.c,v 1.16.2.1.2.1 1999/06/21 01:09:12 thorpej Exp $  */
+/*     $NetBSD: sunos_exec.c,v 1.16.2.1.2.2 1999/07/04 01:33:35 chs Exp $      */
 
 /*
  * Copyright (c) 1993 Theo de Raadt
@@ -167,7 +167,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/kern/exec_aout.c
--- a/sys/kern/exec_aout.c      Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/kern/exec_aout.c      Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp $       */
+/*     $NetBSD: exec_aout.c,v 1.15.24.1 1999/07/04 01:33:35 chs Exp $  */
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -126,7 +126,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        epp->ep_vp->v_flag |= VTEXT;
+       ubc_flush(&epp->ep_vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, execp->a_text,
diff -r 9888ecc35f54 -r 73aee175f6fc sys/kern/exec_ecoff.c
--- a/sys/kern/exec_ecoff.c     Sun Jul 04 01:27:57 1999 +0000
+++ b/sys/kern/exec_ecoff.c     Sun Jul 04 01:33:33 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_ecoff.c,v 1.9.24.1 1999/06/21 01:23:59 thorpej Exp $      */
+/*     $NetBSD: exec_ecoff.c,v 1.9.24.2 1999/07/04 01:33:35 chs Exp $  */
 
 /*
  * Copyright (c) 1994 Adam Glass
@@ -260,7 +260,15 @@
 #endif
                return ETXTBSY;
        }
+
+       /*
+        * mark this vnode as being the image of a running process.
+        * also flush any cached file mappings now so the process will
+        * have a better chance of being able to use the cache.
+        */
+
        vp->v_flag |= VTEXT;
+       ubc_flush(&vp->v_uvm.u_obj, 0, 0);
 
        /* set up command for text segment */



Home | Main Index | Thread Index | Old Index