- 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
This commit is contained in:
John Baldwin 2002-10-01 14:10:08 +00:00
parent c2b6013026
commit 1d56414515

View File

@ -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.