Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca531a0a authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

[PATCH] posix-timers: exit path cleanup



No need to rebalance when task exited

Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3de463c7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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);