All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org,
	dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com,
	oleg@redhat.com
Subject: Re: [PATCH tip/core/rcu 7/9] rcu: Pretend ->boost_mtx acquired legitimately
Date: Thu, 5 Oct 2017 08:06:06 -0700	[thread overview]
Message-ID: <20171005150606.GQ3521@linux.vnet.ibm.com> (raw)
In-Reply-To: <20171005095059.5hm2pumwpv75gvuk@hirez.programming.kicks-ass.net>

On Thu, Oct 05, 2017 at 11:50:59AM +0200, Peter Zijlstra wrote:
> On Wed, Oct 04, 2017 at 02:29:33PM -0700, Paul E. McKenney wrote:
> > RCU priority boosting uses rt_mutex_init_proxy_locked() to initialize an
> > rt_mutex structure in locked state held by some other task.  When that
> > other task releases it, lockdep complains (quite accurately, but a bit
> > uselessly) that the other task never acquired it.  This complaint can
> > suppress other, more helpful, lockdep complaints, and in any case it is
> > a false positive.
> > 
> > This commit therefore uses the mutex_acquire() macro to make it look
> > like that other process legitimately acquired the lock, thus suppressing
> > this lockdep false-positive complaint.
> > 
> > Of course, if lockdep ever learns about rt_mutex_init_proxy_locked(),
> > this commit will need to be reverted.
> > 
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> This is a consequence of me doing:
> 
>  f5694788ad8d ("rt_mutex: Add lockdep annotations")
> 
> Right?

The timing matches, so I do believe this is the case.

> > ---
> >  kernel/rcu/tree_plugin.h | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> > index fed95fa941e6..60bfb16c9a1a 100644
> > --- a/kernel/rcu/tree_plugin.h
> > +++ b/kernel/rcu/tree_plugin.h
> > @@ -529,8 +529,11 @@ void rcu_read_unlock_special(struct task_struct *t)
> >  		}
> >  
> >  		/* Unboost if we were boosted. */
> > -		if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex)
> > +		if (IS_ENABLED(CONFIG_RCU_BOOST) && drop_boost_mutex) {
> > +			/* For lockdep, pretend we acquired lock honestly. */
> > +			mutex_acquire(&rnp->boost_mtx.dep_map, 0, 0, _RET_IP_);
> >  			rt_mutex_unlock(&rnp->boost_mtx);
> > +		}
> 
> So I'm thinking the problem is that you're mixing rt_mutex and PI-futex
> primitives here. As per commit:
> 
>   5293c2efda37 ("futex,rt_mutex: Provide futex specific rt_mutex API")
> 
> these are two separate APIs, that should, ideally, not be mixed.
> 
> The 'right' counterpart to rt_mutex_init_proxy_locked() is
> rt_mutex_futex_unlock() (which very much does not include lockdep bits).

OK, will give this a try.  It does at least seem to build, so I guess
that is a good start.  ;-)

							Thanx, Paul

  reply	other threads:[~2017-10-05 15:06 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 21:29 [PATCH tip/core/rcu 0/9] Miscellaneous fixes for v4.15 Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 1/9] rcu: Provide GP ordering in face of migrations and delays Paul E. McKenney
2017-10-05  9:41   ` Peter Zijlstra
2017-10-05 14:55     ` Paul E. McKenney
2017-10-05 15:39       ` Peter Zijlstra
2017-10-05 16:19         ` Paul E. McKenney
2017-10-05 16:25           ` Peter Zijlstra
2017-10-05 18:22             ` Paul E. McKenney
2017-10-06  9:07               ` Peter Zijlstra
2017-10-06 19:18                 ` Paul E. McKenney
2017-10-06 20:15                   ` Peter Zijlstra
2017-10-07  3:31                     ` Paul E. McKenney
2017-10-07  9:29                       ` Peter Zijlstra
2017-10-07 18:28                         ` Paul E. McKenney
2017-10-09  8:16                           ` Peter Zijlstra
2017-10-09 14:37                             ` Andrea Parri
2017-10-09 23:15                             ` Paul E. McKenney
2017-10-05 13:17   ` Steven Rostedt
2017-10-05 13:40     ` Peter Zijlstra
2017-10-05 14:13       ` Steven Rostedt
2017-10-04 21:29 ` [PATCH tip/core/rcu 2/9] rcu: Fix up pending cbs check in rcu_prepare_for_idle Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 3/9] rcu: Create call_rcu_tasks() kthread at boot time Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 4/9] irq_work: Map irq_work_on_queue() to irq_work_on() in !SMP Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 5/9] srcu: Add parameters to SRCU docbook comments Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 6/9] sched: Make resched_cpu() unconditional Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 7/9] rcu: Pretend ->boost_mtx acquired legitimately Paul E. McKenney
2017-10-05  9:50   ` Peter Zijlstra
2017-10-05 15:06     ` Paul E. McKenney [this message]
2017-10-04 21:29 ` [PATCH tip/core/rcu 8/9] rcu: Add extended-quiescent-state testing advice Paul E. McKenney
2017-10-04 21:29 ` [PATCH tip/core/rcu 9/9] rcu/segcblist: Include rcupdate.h Paul E. McKenney

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=20171005150606.GQ3521@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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 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.