summaryrefslogtreecommitdiffstats
path: root/kernel/posix-cpu-timers.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2005-10-24 14:36:28 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-24 08:12:35 -0700
commitca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b (patch)
tree4dc28c012d1bb78aba82acdcd2462d17020ba77e /kernel/posix-cpu-timers.c
parent3de463c7d9d58f8cf3395268230cb20a4c15bffa (diff)
downloadop-kernel-dev-ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b.zip
op-kernel-dev-ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b.tar.gz
[PATCH] posix-timers: exit path cleanup
No need to rebalance when task exited Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/posix-cpu-timers.c')
-rw-r--r--kernel/posix-cpu-timers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
index ccb0468..92a0380 100644
--- a/kernel/posix-cpu-timers.c
+++ b/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);
OpenPOWER on IntegriCloud