Messages in this thread Patch in this message | | | Date | Wed, 19 Jan 2005 12:54:44 -0800 | From | Roland McGrath <> | Subject | [PATCH] cputime_t patches broke RLIMIT_CPU |
| |
The RLIMIT_CPU limit is in seconds, not in jiffies.
Signed-off-by: Roland McGrath <roland@redhat.com>
--- linux-2.6/kernel/sched.c +++ linux-2.6/kernel/sched.c @@ -2301,14 +2327,14 @@ static void check_rlimit(struct task_str cputime_t total, tmp; total = cputime_add(p->utime, p->stime); - tmp = jiffies_to_cputime(p->signal->rlim[RLIMIT_CPU].rlim_cur); + tmp = secs_to_cputime(p->signal->rlim[RLIMIT_CPU].rlim_cur); if (unlikely(cputime_gt(total, tmp))) { /* Send SIGXCPU every second. */ tmp = cputime_sub(total, cputime); if (cputime_to_secs(tmp) < cputime_to_secs(total)) send_sig(SIGXCPU, p, 1); /* and SIGKILL when we go over max.. */ - tmp = jiffies_to_cputime(p->signal->rlim[RLIMIT_CPU].rlim_max); + tmp = secs_to_cputime(p->signal->rlim[RLIMIT_CPU].rlim_max); if (cputime_gt(total, tmp)) send_sig(SIGKILL, p, 1); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |