diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2023-08-30 09:02:39 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2023-08-30 09:02:39 +0000 |
commit | 3338ad5468ee38dae937b3436824796e0433808f (patch) | |
tree | 09cdf67c7c650ff7ef13cc226905a6b828d86eab /sys/kern/sched_bsd.c | |
parent | dee2af4c77cfb2d9626179f2f2b8279feaa86026 (diff) |
Preempt a running proc even if there is no other process/thread queued
on that CPU's runqueue. This way mi_switch() is invoked which is necessary
to a) signal srm that the cpu changed context b) runtime stats are updated
c) requests to stop the CPU are checked.
This should fix the issue reported by Eric Wong (e at 80x24 org) that
RLIMIT_CPU is unreliable on idle systems.
OK kettenis@ cheloha@
Diffstat (limited to 'sys/kern/sched_bsd.c')
-rw-r--r-- | sys/kern/sched_bsd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sched_bsd.c b/sys/kern/sched_bsd.c index 465624e589d..2f9ef56aee1 100644 --- a/sys/kern/sched_bsd.c +++ b/sys/kern/sched_bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sched_bsd.c,v 1.84 2023/08/29 16:19:34 claudio Exp $ */ +/* $OpenBSD: sched_bsd.c,v 1.85 2023/08/30 09:02:38 claudio Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /*- @@ -106,7 +106,7 @@ roundrobin(struct clockintr *cl, void *cf) } } - if (spc->spc_nrun) + if (spc->spc_nrun || spc->spc_schedflags & SPCF_SHOULDYIELD) need_resched(ci); } |