Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/kern Pull up revision 1.25 (requested by junyoung i...



details:   https://anonhg.NetBSD.org/src/rev/5b5bd3921782
branches:  netbsd-1-6
changeset: 530770:5b5bd3921782
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Oct 02 09:51:28 2003 +0000

description:
Pull up revision 1.25 (requested by junyoung in ticket #1488):
count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).

diffstat:

 sys/kern/exec_aout.c |  22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

diffs (50 lines):

diff -r ed8e70a19f33 -r 5b5bd3921782 sys/kern/exec_aout.c
--- a/sys/kern/exec_aout.c      Thu Oct 02 09:37:52 2003 +0000
+++ b/sys/kern/exec_aout.c      Thu Oct 02 09:51:28 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_aout.c,v 1.22.10.2 2003/09/27 15:53:20 tron Exp $ */
+/*     $NetBSD: exec_aout.c,v 1.22.10.3 2003/10/02 09:51:28 tron Exp $ */
 
 /*
  * Copyright (c) 1993, 1994 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_aout.c,v 1.22.10.2 2003/09/27 15:53:20 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_aout.c,v 1.22.10.3 2003/10/02 09:51:28 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -106,6 +106,7 @@
 exec_aout_prep_zmagic(struct proc *p, struct exec_package *epp)
 {
        struct exec *execp = epp->ep_hdr;
+       int error;
 
        epp->ep_taddr = USRTEXT;
        epp->ep_tsize = execp->a_text;
@@ -113,20 +114,9 @@
        epp->ep_dsize = execp->a_data + execp->a_bss;
        epp->ep_entry = execp->a_entry;
 
-       /*
-        * check if vnode is in open for writing, because we want to
-        * demand-page out of it.  if it is, don't do it, for various
-        * reasons
-        */
-       if ((execp->a_text != 0 || execp->a_data != 0) &&
-           epp->ep_vp->v_writecount != 0) {
-#ifdef DIAGNOSTIC
-               if (epp->ep_vp->v_flag & VTEXT)
-                       panic("exec: a VTEXT vnode has writecount != 0");
-#endif
-               return ETXTBSY;
-       }
-       epp->ep_vp->v_flag |= VTEXT;
+       error = vn_marktext(epp->ep_vp);
+       if (error)
+               return (error);
 
        /* set up command for text segment */
        NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_pagedvn, round_page(execp->a_text),



Home | Main Index | Thread Index | Old Index