diff options
| author | 2020-01-30 08:51:27 +0000 | |
|---|---|---|
| committer | 2020-01-30 08:51:27 +0000 | |
| commit | 24e0bd456b2461b3f663055f18aa3ccc17259829 (patch) | |
| tree | d77ead955a4e4821a5ad6b6baacb0ebf8e316a3e /sys/kern/kern_fork.c | |
| parent | Enable t_ptrace with an errno change compared to NetBSD. (diff) | |
| download | wireguard-openbsd-24e0bd456b2461b3f663055f18aa3ccc17259829.tar.xz wireguard-openbsd-24e0bd456b2461b3f663055f18aa3ccc17259829.zip | |
Split `p_priority' into `p_runpri' and `p_slppri'.
Using different fields to remember in which runqueue or sleepqueue
threads currently are will make it easier to split the SCHED_LOCK().
With this change, the (potentially boosted) sleeping priority is no
longer overwriting the thread priority. This let us get rids of the
logic required to synchronize `p_priority' with `p_usrpri'.
Tested by many, ok visa@
Diffstat (limited to 'sys/kern/kern_fork.c')
| -rw-r--r-- | sys/kern/kern_fork.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 1f74865ed6a..6308e037832 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.221 2020/01/21 15:20:47 visa Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.222 2020/01/30 08:51:27 mpi Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -148,6 +148,7 @@ thread_new(struct proc *parent, vaddr_t uaddr) p = pool_get(&proc_pool, PR_WAITOK); p->p_stat = SIDL; /* protect against others */ + p->p_runpri = 0; p->p_flag = 0; /* @@ -314,7 +315,7 @@ fork_thread_start(struct proc *p, struct proc *parent, int flags) SCHED_LOCK(s); ci = sched_choosecpu_fork(parent, flags); - setrunqueue(ci, p, p->p_priority); + setrunqueue(ci, p, p->p_usrpri); SCHED_UNLOCK(s); } |
