lkml.org 
[lkml]   [2011]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: process time < thread time?
From
Date
On Thu, 2011-09-01 at 11:56 +0200, Thomas Gleixner wrote:
> The untested patch below should cure this.
>

> diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
> index 58f405b..42378cb 100644
> --- a/kernel/posix-cpu-timers.c
> +++ b/kernel/posix-cpu-timers.c
> @@ -250,7 +250,7 @@ void thread_group_cputime(struct task_struct *tsk,
> struct task_cputime *times)
> 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;
> + times->sum_exec_runtime += task_sched_runtime(t);
> } while_each_thread(tsk, t);
> out:
> rcu_read_unlock();

I think we just deadlocked:

cpu_clock_sample_group()
CPUCLOCK_SCHED: thread_group_sched_runtime()
task_rq_lock() <-.
thread_group_cputime() |
task_sched_runtime() |
task_rq_lock() ------'

Also, having to take locks here is sad, but yeah if we want to cure this
there's not much we can do about that.


\
 
 \ /
  Last update: 2011-09-01 12:13    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site