From: Oleg Nesterov Date: Mon, 24 Oct 2005 10:36:28 +0000 (+0400) Subject: [PATCH] posix-timers: exit path cleanup X-Git-Tag: v2.6.14~28 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=ca531a0a5e01e5122f67cb6aca8fcbfc70e18e0b;p=safe%2Fjmp%2Flinux-2.6 [PATCH] posix-timers: exit path cleanup No need to rebalance when task exited Signed-off-by: Oleg Nesterov Signed-off-by: Linus Torvalds --- 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);