public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Sasha Levin <levinsasha928@gmail.com>,
	Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Dave Jones <davej@redhat.com>
Subject: Re: rcu,sched: spinlock recursion on 3.5-rc2
Date: Tue, 12 Jun 2012 08:22:52 -0700	[thread overview]
Message-ID: <20120612152252.GC2423@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1206121701350.3086@ionos>

On Tue, Jun 12, 2012 at 05:07:37PM +0200, Thomas Gleixner wrote:
> On Tue, 12 Jun 2012, Paul E. McKenney wrote:
> > On Tue, Jun 12, 2012 at 03:40:13PM +0200, Thomas Gleixner wrote:
> > > The torture thread got preempted. rcu_preempt_note_context_switch()
> > > tries to unlock the boosting rt mutex.
> > > 
> > > Though rcu_preempt_note_context_switch() is called with rq lock
> > > held. So it's not a surprise that the code will dead lock.
> > > 
> > > My brain hurts already from looking, so Paul to the rescue!
> > 
> > My brain hurts from beating my head on my desk.  It seems that attempts
> > to enhance PREEMPT_RCU's read-side performance require even more paranoia
> > than I normally bring to bear.  :-/
> > 
> > Please see below for what I expect is the relevant revert.
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > Revert "rcu: Move PREEMPT_RCU preemption to switch_to() invocation"
> > 
> > This reverts commit 616c310e83b872024271c915c1b9ab505b9efad9
> > (Move PREEMPT_RCU preemption to switch_to() invocation) which can
> > result in runqueue deadlock.
> 
> Hmm, not sure. The deadlock was not triggered in switch_to. It was
> just at the beginning of __schedule()
> 
> need_resched:
> 	preempt_disable();
>         cpu = smp_processor_id();
> 	rq = cpu_rq(cpu);
>         rcu_note_context_switch(cpu);
> 	
> 	Which ends up in rcu_read_unlock_special() which tries to
> 	unlock the rtmutex.
> 
> So that code is still there ....

???

rcu_note_context_switch() does not call rcu_preempt_note_context_switch()
unless the patch is reverted.  No rcu_preempt_note_context_switch(),
no rcu_read_unlock_special().

Besides which, unless I am even more confused than normal, __schedule()
doesn't hold any runqueue locks at this point.  However, those locks
really are held across the call to switch_to() in context_switch().

I bet that gcc inlined context_switch().

							Thanx, Paul


      parent reply	other threads:[~2012-06-12 15:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 11:35 rcu,sched: spinlock recursion on 3.5-rc2 Sasha Levin
2012-06-12 13:40 ` Thomas Gleixner
2012-06-12 14:47   ` Paul E. McKenney
2012-06-12 15:07     ` Thomas Gleixner
2012-06-12 15:15       ` Peter Zijlstra
2012-06-12 15:20         ` Thomas Gleixner
2012-06-12 15:25           ` Paul E. McKenney
2012-06-12 15:31         ` Sasha Levin
2012-06-12 15:22       ` Paul E. McKenney [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=20120612152252.GC2423@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=davej@redhat.com \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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