| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: kern_proc.c,v 1.199 2016/11/14 08:55:51 kre Exp $ */ | | 1 | /* $NetBSD: kern_proc.c,v 1.200 2017/01/26 03:54:54 christos Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, |
9 | * NASA Ames Research Center, and by Andrew Doran. | | 9 | * NASA Ames Research Center, and by Andrew Doran. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -52,27 +52,27 @@ | | | @@ -52,27 +52,27 @@ |
52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
59 | * SUCH DAMAGE. | | 59 | * SUCH DAMAGE. |
60 | * | | 60 | * |
61 | * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 | | 61 | * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 |
62 | */ | | 62 | */ |
63 | | | 63 | |
64 | #include <sys/cdefs.h> | | 64 | #include <sys/cdefs.h> |
65 | __KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.199 2016/11/14 08:55:51 kre Exp $"); | | 65 | __KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.200 2017/01/26 03:54:54 christos Exp $"); |
66 | | | 66 | |
67 | #ifdef _KERNEL_OPT | | 67 | #ifdef _KERNEL_OPT |
68 | #include "opt_kstack.h" | | 68 | #include "opt_kstack.h" |
69 | #include "opt_maxuprc.h" | | 69 | #include "opt_maxuprc.h" |
70 | #include "opt_dtrace.h" | | 70 | #include "opt_dtrace.h" |
71 | #include "opt_compat_netbsd32.h" | | 71 | #include "opt_compat_netbsd32.h" |
72 | #endif | | 72 | #endif |
73 | | | 73 | |
74 | #include <sys/param.h> | | 74 | #include <sys/param.h> |
75 | #include <sys/systm.h> | | 75 | #include <sys/systm.h> |
76 | #include <sys/kernel.h> | | 76 | #include <sys/kernel.h> |
77 | #include <sys/proc.h> | | 77 | #include <sys/proc.h> |
78 | #include <sys/resourcevar.h> | | 78 | #include <sys/resourcevar.h> |
| @@ -94,26 +94,29 @@ __KERNEL_RCSID(0, "$NetBSD: kern_proc.c, | | | @@ -94,26 +94,29 @@ __KERNEL_RCSID(0, "$NetBSD: kern_proc.c, |
94 | #include <sys/kauth.h> | | 94 | #include <sys/kauth.h> |
95 | #include <sys/sleepq.h> | | 95 | #include <sys/sleepq.h> |
96 | #include <sys/atomic.h> | | 96 | #include <sys/atomic.h> |
97 | #include <sys/kmem.h> | | 97 | #include <sys/kmem.h> |
98 | #include <sys/namei.h> | | 98 | #include <sys/namei.h> |
99 | #include <sys/dtrace_bsd.h> | | 99 | #include <sys/dtrace_bsd.h> |
100 | #include <sys/sysctl.h> | | 100 | #include <sys/sysctl.h> |
101 | #include <sys/exec.h> | | 101 | #include <sys/exec.h> |
102 | #include <sys/cpu.h> | | 102 | #include <sys/cpu.h> |
103 | | | 103 | |
104 | #include <uvm/uvm_extern.h> | | 104 | #include <uvm/uvm_extern.h> |
105 | #include <uvm/uvm.h> | | 105 | #include <uvm/uvm.h> |
106 | | | 106 | |
| | | 107 | #ifndef COMPAT_NETBSD32 |
| | | 108 | #define COMPAT_NETBSD32 |
| | | 109 | #endif |
107 | #ifdef COMPAT_NETBSD32 | | 110 | #ifdef COMPAT_NETBSD32 |
108 | #include <compat/netbsd32/netbsd32.h> | | 111 | #include <compat/netbsd32/netbsd32.h> |
109 | #endif | | 112 | #endif |
110 | | | 113 | |
111 | /* | | 114 | /* |
112 | * Process lists. | | 115 | * Process lists. |
113 | */ | | 116 | */ |
114 | | | 117 | |
115 | struct proclist allproc __cacheline_aligned; | | 118 | struct proclist allproc __cacheline_aligned; |
116 | struct proclist zombproc __cacheline_aligned; | | 119 | struct proclist zombproc __cacheline_aligned; |
117 | | | 120 | |
118 | kmutex_t * proc_lock __cacheline_aligned; | | 121 | kmutex_t * proc_lock __cacheline_aligned; |
119 | | | 122 | |