summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-10-01 14:10:08 +0000
committerjhb <jhb@FreeBSD.org>2002-10-01 14:10:08 +0000
commit02678fb50e4db0e297f81b01c53970592399fe48 (patch)
tree4ccf916421c5f48c1dce43a4dee555fde1729e80 /sys/kern/kern_synch.c
parent43df880dc16d5c92f4b9cb807a82049f97021978 (diff)
downloadFreeBSD-src-02678fb50e4db0e297f81b01c53970592399fe48.zip
FreeBSD-src-02678fb50e4db0e297f81b01c53970592399fe48.tar.gz
- Adjust comment noting that handling of CPU limit exhaustion is done in
ast(). - Actually set KEF_ASTPENDING so ast() is called. I think this is buggy for a process with multiple KSE's in that PS_XCPU is not a KSE event, it's a process-wide event. IMO there really should probably be two ASTPENDING flags, one for per-process, and one for per-KSE. Submitted by: bde
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 6b37181..d46ef12 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -786,12 +786,15 @@ mi_switch(void)
#endif
/*
- * Check if the process exceeds its cpu resource allocation.
+ * Check if the process exceeds its cpu resource allocation. If
+ * over max, arrange to kill the process in ast().
*/
if (p->p_state != PRS_ZOMBIE &&
p->p_limit->p_cpulimit != RLIM_INFINITY &&
- p->p_runtime.sec > p->p_limit->p_cpulimit)
+ p->p_runtime.sec > p->p_limit->p_cpulimit) {
p->p_sflag |= PS_XCPU;
+ ke->ke_flags |= KEF_ASTPENDING;
+ }
/*
* Finish up stats for outgoing thread.
OpenPOWER on IntegriCloud