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/init_main.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/init_main.c')
| -rw-r--r-- | sys/kern/init_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 22a510c1f0d..0a4af1b1399 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.285 2019/05/31 04:46:18 visa Exp $ */ +/* $OpenBSD: init_main.c,v 1.286 2019/05/31 19:51:09 mpi Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -518,7 +518,9 @@ main(void *framep) getnanotime(&pr->ps_start); TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) { nanouptime(&p->p_cpu->ci_schedstate.spc_runtime); + mtx_enter(&pr->ps_mtx); timespecclear(&p->p_rtime); + mtx_leave(&pr->ps_mtx); } } |
