From 971588358c152477d20c602d38603d3db57ce115 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 24 Oct 2005 14:36:28 +0400 Subject: [PATCH] --- yaml --- r: 10085 b: refs/heads/master c: ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b h: refs/heads/master i: 10083: 295d6ad96875c3f844fe80fe03342e940638b795 v: v3 --- [refs] | 2 +- trunk/kernel/posix-cpu-timers.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c648350a3415..14ffd7270ee3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3de463c7d9d58f8cf3395268230cb20a4c15bffa +refs/heads/master: ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b diff --git a/trunk/kernel/posix-cpu-timers.c b/trunk/kernel/posix-cpu-timers.c index ccb04683bf18..92a038064628 100644 --- a/trunk/kernel/posix-cpu-timers.c +++ b/trunk/kernel/posix-cpu-timers.c @@ -486,6 +486,9 @@ static void process_timer_rebalance(struct task_struct *p, struct task_struct *t = p; unsigned int nthreads = atomic_read(&p->signal->live); + if (!nthreads) + return; + switch (clock_idx) { default: BUG(); @@ -1160,6 +1163,9 @@ static void check_process_timers(struct task_struct *tsk, unsigned long long sched_left, sched; const unsigned int nthreads = atomic_read(&sig->live); + if (!nthreads) + return; + prof_left = cputime_sub(prof_expires, utime); prof_left = cputime_sub(prof_left, stime); prof_left = cputime_div(prof_left, nthreads);