Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix fallout from the new tests exercising all error...



details:   https://anonhg.NetBSD.org/src/rev/e80ce15f1a5a
branches:  trunk
changeset: 773750:e80ce15f1a5a
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 15 11:59:30 2012 +0000

description:
Fix fallout from the new tests exercising all error paths: do not deactivate
the pmap of a vmspace-less child of a posix spawn operation that never
made it to userland.

diffstat:

 sys/kern/kern_exit.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 53211c88b876 -r e80ce15f1a5a sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Wed Feb 15 04:33:19 2012 +0000
+++ b/sys/kern/kern_exit.c      Wed Feb 15 11:59:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.235 2011/10/09 20:30:37 chs Exp $      */
+/*     $NetBSD: kern_exit.c,v 1.236 2012/02/15 11:59:30 martin Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.235 2011/10/09 20:30:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.236 2012/02/15 11:59:30 martin Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_perfctrs.h"
@@ -580,7 +580,12 @@
         * case these resources are in the PCB.
         */
        cpu_lwp_free(l, 1);
-       pmap_deactivate(l);
+       /*
+        * A new child of a posix_spawn operation might never have been
+        * to userland - no pmap deactivation is needed in this case
+        */
+       if (__predict_true(l->l_proc->p_vmspace != NULL))
+               pmap_deactivate(l);
 
        /* This process no longer needs to hold the kernel lock. */
 #ifdef notyet



Home | Main Index | Thread Index | Old Index