- 论坛徽章:
- 4
|
5可用积分
from 3.6.10 check_process_timers()- /*
- * Check for the special case process timers.
- */
- check_cpu_itimer(tsk, &sig->it[CPUCLOCK_PROF], &prof_expires, ptime,
- SIGPROF);
- check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime,
- SIGVTALRM);
- soft = ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_cur);
- if (soft != RLIM_INFINITY) {
- unsigned long psecs = cputime_to_secs(ptime);
- unsigned long hard =
- ACCESS_ONCE(sig->rlim[RLIMIT_CPU].rlim_max);
- cputime_t x;
- if (psecs >= hard) {
- /*
- * At the hard limit, we just die.
- * No need to calculate anything else now.
- */
- __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk);
- return;
- }
- if (psecs >= soft) {
- /*
- * At the soft limit, send a SIGXCPU every second.
- */
- __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk);
- if (soft < hard) {
- soft++;
- sig->rlim[RLIMIT_CPU].rlim_cur = soft;
- }
- }
- x = secs_to_cputime(soft);
- if (!prof_expires || x < prof_expires) {
- prof_expires = x;
- }
- }
复制代码 这里是设置rlim[RLIMIT_CPU].rlim_cur就是设置每个进程的total执行时间?
还能有这个限制? 奇怪, 请指点!谢谢!
有人说这个字段的含义是:cpu limit time in second, 在1s内该进程的total执行时间? |
|