diff options
| author | 2014-07-26 16:07:39 +0000 | |
|---|---|---|
| committer | 2014-07-26 16:07:39 +0000 | |
| commit | 93a6d3839794d512216714b0772d7a3e14c9d9b4 (patch) | |
| tree | 9463c7e6763e46f84be6099bbd27ca56926cc48d /sys/kern/kern_sched.c | |
| parent | Revert "adjust -C algorithm to be more aggressive in scaling up" for (diff) | |
| download | wireguard-openbsd-93a6d3839794d512216714b0772d7a3e14c9d9b4.tar.xz wireguard-openbsd-93a6d3839794d512216714b0772d7a3e14c9d9b4.zip | |
If we're stopping a secondary cpu, don't let sched_choosecpu() short-circuit
and return the current current CPU, otherwise sched_stop_secondary_cpus()
will spin forever trying to empty its run queues. Fixes hangs during suspend
that many people reported over the last couple of days.
ok bcook@, guenther@
Diffstat (limited to 'sys/kern/kern_sched.c')
| -rw-r--r-- | sys/kern/kern_sched.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 671772617a3..6047611c209 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.33 2014/07/13 21:44:58 matthew Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.34 2014/07/26 16:07:39 kettenis Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski <art@openbsd.org> * @@ -275,6 +275,7 @@ sched_chooseproc(void) while ((p = TAILQ_FIRST(&spc->spc_qs[queue]))) { remrunqueue(p); p->p_cpu = sched_choosecpu(p); + KASSERT(p->p_cpu != curcpu()); setrunqueue(p); } } @@ -408,6 +409,7 @@ sched_choosecpu(struct proc *p) */ if (cpuset_isset(&set, p->p_cpu) || (p->p_cpu == curcpu() && p->p_cpu->ci_schedstate.spc_nrun == 0 && + (p->p_cpu->ci_schedstate.spc_schedflags & SPCF_SHOULDHALT) == 0 && curproc == p)) { sched_wasidle++; return (p->p_cpu); |
