diff options
author | 2019-05-31 19:51:09 +0000 | |
---|---|---|
committer | 2019-05-31 19:51:09 +0000 | |
commit | 4b91b74a18bc983f4cced5ae0e1d3b81f991786d (patch) | |
tree | 29d70291869a15eda0161c68981def08ec425f62 /sys/kern/kern_fork.c | |
parent | Re-enable frame pointer elimination for x86 and mips64 if optimizations are (diff) | |
download | wireguard-openbsd-4b91b74a18bc983f4cced5ae0e1d3b81f991786d.tar.xz wireguard-openbsd-4b91b74a18bc983f4cced5ae0e1d3b81f991786d.zip |
Use a per-process mutex to protect time accounting instead of SCHED_LOCK().
Note that hardclock(9) still increments p_{u,s,i}ticks without holding a
lock.
ok visa@, cheloha@
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r-- | sys/kern/kern_fork.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 0d7f58bf890..4bf393afb84 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.210 2019/05/31 04:46:18 visa Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.211 2019/05/31 19:51:09 mpi Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -55,6 +55,7 @@ #include <sys/sysctl.h> #include <sys/pool.h> #include <sys/mman.h> +#include <sys/mutex.h> #include <sys/ptrace.h> #include <sys/atomic.h> #include <sys/pledge.h> @@ -210,6 +211,8 @@ process_initialize(struct process *pr, struct proc *p) LIST_INIT(&pr->ps_kqlist); LIST_INIT(&pr->ps_sigiolst); + mtx_init(&pr->ps_mtx, IPL_MPFLOOR); + timeout_set(&pr->ps_realit_to, realitexpire, pr); timeout_set(&pr->ps_rucheck_to, rucheck, pr); } |