提交 ca531a0a 编写于 作者: O Oleg Nesterov 提交者: Linus Torvalds

[PATCH] posix-timers: exit path cleanup

No need to rebalance when task exited
Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3de463c7
...@@ -486,6 +486,9 @@ static void process_timer_rebalance(struct task_struct *p, ...@@ -486,6 +486,9 @@ static void process_timer_rebalance(struct task_struct *p,
struct task_struct *t = p; struct task_struct *t = p;
unsigned int nthreads = atomic_read(&p->signal->live); unsigned int nthreads = atomic_read(&p->signal->live);
if (!nthreads)
return;
switch (clock_idx) { switch (clock_idx) {
default: default:
BUG(); BUG();
...@@ -1160,6 +1163,9 @@ static void check_process_timers(struct task_struct *tsk, ...@@ -1160,6 +1163,9 @@ static void check_process_timers(struct task_struct *tsk,
unsigned long long sched_left, sched; unsigned long long sched_left, sched;
const unsigned int nthreads = atomic_read(&sig->live); const unsigned int nthreads = atomic_read(&sig->live);
if (!nthreads)
return;
prof_left = cputime_sub(prof_expires, utime); prof_left = cputime_sub(prof_expires, utime);
prof_left = cputime_sub(prof_left, stime); prof_left = cputime_sub(prof_left, stime);
prof_left = cputime_div(prof_left, nthreads); prof_left = cputime_div(prof_left, nthreads);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册