linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: David Miller <davem@davemloft.net>, linux-kernel@vger.kernel.org
Subject: Re: process time < thread time?
Date: Thu, 1 Sep 2011 12:39:05 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1109011226160.2723@ionos> (raw)
In-Reply-To: <1314871884.7945.20.camel@twins>

On Thu, 1 Sep 2011, Peter Zijlstra wrote:

> 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:

That's why I said untested :)
 
> 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.

Yeah :(
 

  reply	other threads:[~2011-09-01 10:39 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
2011-09-01 10:39     ` Thomas Gleixner [this message]
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=alpine.LFD.2.02.1109011226160.2723@ionos \
    --to=tglx@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).