]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
getrusage: RUSAGE_THREAD should return ru_utime and ru_stime
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Sat, 3 Jan 2009 20:40:37 +0000 (05:40 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 18 Jan 2009 18:44:05 +0000 (10:44 -0800)
commit 8916edef5888c5d8fe283714416a9ca95b4c3431 upstream.

Impact: task stats regression fix

Original getrusage(RUSAGE_THREAD) implementation can return ru_utime and
ru_stime. But commit "f06febc: timers: fix itimer/many thread hang" broke it.

this patch restores it.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/sys.c

index 1753312b02f2543d8e5b300cb265ea1429c9e24f..855eebba42a9365cc9c72c829bc1074f0608b095 100644 (file)
@@ -1553,6 +1553,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
        utime = stime = cputime_zero;
 
        if (who == RUSAGE_THREAD) {
+               utime = task_utime(current);
+               stime = task_stime(current);
                accumulate_thread_rusage(p, r);
                goto out;
        }