]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sched: fix process time monotonicity
authorBalbir Singh <balbir@linux.vnet.ibm.com>
Fri, 5 Sep 2008 16:12:23 +0000 (18:12 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Oct 2008 03:22:56 +0000 (20:22 -0700)
commit092609f380fe84ab974062729942ba6b0be3a78f
tree02c4431d19c6de22656ccf1efe2f32928011c259
parent1fac74ef6eb3ac9e7355c3d43803ef8ec9c0971f
sched: fix process time monotonicity

commit 49048622eae698e5c4ae61f7e71200f265ccc529 upstream

Spencer reported a problem where utime and stime were going negative despite
the fixes in commit b27f03d4bdc145a09fb7b0c0e004b29f1ee555fa. The suspected
reason for the problem is that signal_struct maintains it's own utime and
stime (of exited tasks), these are not updated using the new task_utime()
routine, hence sig->utime can go backwards and cause the same problem
to occur (sig->utime, adds tsk->utime and not task_utime()). This patch
fixes the problem

TODO: using max(task->prev_utime, derived utime) works for now, but a more
generic solution is to implement cputime_max() and use the cputime_gt()
function for comparison.

Reported-by: spencer@bluehost.com
Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/proc/array.c
include/linux/sched.h
kernel/exit.c
kernel/sched.c