From: Greg KH <greg@kroah.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Jones <davej@redhat.com>, Simon Kirby <sim@hostway.ca>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Linus Torvalds <torvalds@linux-foundation.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
stable@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Patch Upstream: cputimer: Cure lock inversion
Date: Wed, 19 Oct 2011 13:01:24 -0700 [thread overview]
Message-ID: <20111019200124.GA16108@kroah.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1110192140270.3197@ionos>
On Wed, Oct 19, 2011 at 09:41:52PM +0200, Thomas Gleixner wrote:
> On Wed, 19 Oct 2011, Greg KH wrote:
>
> > On Wed, Oct 19, 2011 at 11:39:14AM -0400, Gregs git-bot wrote:
> > > commit: bcd5cff7216f9b2de0a148cc355eac199dc6f1cf
> > > From: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > > Date: Mon, 17 Oct 2011 11:50:30 +0200
> > > Subject: cputimer: Cure lock inversion
> > >
> > > There's a lock inversion between the cputimer->lock and rq->lock;
> > > notably the two callchains involved are:
> > >
> > > update_rlimit_cpu()
> > > sighand->siglock
> > > set_process_cpu_timer()
> > > cpu_timer_sample_group()
> > > thread_group_cputimer()
> > > cputimer->lock
> > > thread_group_cputime()
> > > task_sched_runtime()
> > > ->pi_lock
> > > rq->lock
> > >
> > > scheduler_tick()
> > > rq->lock
> > > task_tick_fair()
> > > update_curr()
> > > account_group_exec()
> > > cputimer->lock
> > >
> > > Where the first one is enabling a CLOCK_PROCESS_CPUTIME_ID timer, and
> > > the second one is keeping up-to-date.
> > >
> > > This problem was introduced by e8abccb7193 ("posix-cpu-timers: Cure
> > > SMP accounting oddities").
> >
> > There is no such patch in Linus's tree that I can find. So, what
> > problem is this really trying to cure here and what kernel did it show
> > up in?
>
> Oops. It's in 3.0.7
>
> commit 249cf808ba1a0d403fe7c476a74b66e2bc0a8e53
> Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Date: Thu Sep 1 12:42:04 2011 +0200
>
> posix-cpu-timers: Cure SMP wobbles
>
> commit d670ec13178d0fd8680e6742a2bc6e04f28f87d8 upstream.
>
> and that patch introduced the above deadlock, which is cured by:
>
> commit bcd5cff7216f9b2de0a148cc355eac199dc6f1cf
> Author: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Date: Mon Oct 17 11:50:30 2011 +0200
>
> cputimer: Cure lock inversion
Thanks for the explanation. I should have it all straightened out now.
greg k-h
prev parent reply other threads:[~2011-10-19 20:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20111019153914.9153A2188@git.kroah.org>
2011-10-19 15:49 ` Patch Upstream: cputimer: Cure lock inversion Greg KH
2011-10-19 15:55 ` Josh Boyer
2011-10-19 16:00 ` Greg KH
2011-10-19 16:03 ` Josh Boyer
2011-10-19 16:19 ` Peter Zijlstra
2011-10-19 20:01 ` Greg KH
2011-10-19 19:41 ` Thomas Gleixner
2011-10-19 20:01 ` Greg KH [this message]
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=20111019200124.GA16108@kroah.com \
--to=greg@kroah.com \
--cc=a.p.zijlstra@chello.nl \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.com \
--cc=sim@hostway.ca \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.