Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205431
b: refs/heads/master
c: bfac700
h: refs/heads/master
i:
  205429: 180c0b0
  205427: c3425dd
  205423: 4b70a2e
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Jun 18, 2010
1 parent d694a2a commit f0df0ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 48286d5088a3ba76de40a6b70221632a49cab7a1
refs/heads/master: bfac7009180901f57f20a73c53c3e57b1ce75a1b
21 changes: 7 additions & 14 deletions trunk/kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,31 +232,24 @@ static int cpu_clock_sample(const clockid_t which_clock, struct task_struct *p,

void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
{
struct sighand_struct *sighand;
struct signal_struct *sig;
struct signal_struct *sig = tsk->signal;
struct task_struct *t;

*times = INIT_CPUTIME;
times->utime = sig->utime;
times->stime = sig->stime;
times->sum_exec_runtime = sig->sum_sched_runtime;

rcu_read_lock();
sighand = rcu_dereference(tsk->sighand);
if (!sighand)
/* make sure we can trust tsk->thread_group list */
if (!likely(pid_alive(tsk)))
goto out;

sig = tsk->signal;

t = tsk;
do {
times->utime = cputime_add(times->utime, t->utime);
times->stime = cputime_add(times->stime, t->stime);
times->sum_exec_runtime += t->se.sum_exec_runtime;

t = next_thread(t);
} while (t != tsk);

times->utime = cputime_add(times->utime, sig->utime);
times->stime = cputime_add(times->stime, sig->stime);
times->sum_exec_runtime += sig->sum_sched_runtime;
} while_each_thread(tsk, t);
out:
rcu_read_unlock();
}
Expand Down

0 comments on commit f0df0ea

Please sign in to comment.