CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2019/01/06 05:59:45
Modified files:
sys/kern : kern_exit.c kern_fork.c kern_resource.c
sched_bsd.c
sys/sys : proc.h resourcevar.h
Log message:
Fix unsafe use of ptsignal() in mi_switch().
ptsignal() has to be called with the kernel lock held. As ensuring the
locking in mi_switch() is not easy, and deferring the signaling using
the task API is not possible because of lock order issues in
mi_switch(), move the CPU time checking into a periodic timer where
the kernel can be locked without issues.
With this change, each process has a dedicated resource check timer.
The timer gets activated only when a CPU time limit is set. Because the
checking is not done as frequently as before, some precision is lost.
Use of timers adapted from FreeBSD.
OK tedu@
Reported-by: [email protected]