From: Peter Zijlstra <peterz@infradead.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: David Miller <davem@davemloft.net>, linux-kernel@vger.kernel.org
Subject: Re: process time < thread time?
Date: Thu, 01 Sep 2011 12:11:24 +0200 [thread overview]
Message-ID: <1314871884.7945.20.camel@twins> (raw)
In-Reply-To: <alpine.LFD.2.02.1109011148060.2723@ionos>
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.
next prev parent reply other threads:[~2011-09-01 10:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 3:07 process time < thread time? David Miller
2011-09-01 9:56 ` Thomas Gleixner
2011-09-01 10:11 ` Peter Zijlstra [this message]
2011-09-01 10:39 ` Thomas Gleixner
2011-09-01 10:54 ` Peter Zijlstra
2011-09-01 14:54 ` Thomas Gleixner
2011-09-01 14:56 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314871884.7945.20.camel@twins \
--to=peterz@infradead.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox